[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_UI_CHROME_PAGES_H_ |
| 6 | #define CHROME_BROWSER_UI_CHROME_PAGES_H_ |
[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 7 | |
[email protected] | 7a19ea2 | 2012-08-02 14:39:39 | [diff] [blame] | 8 | #include <string> |
| 9 | |
[email protected] | cc1569b | 2013-10-28 21:29:10 | [diff] [blame] | 10 | #include "chrome/browser/ui/host_desktop.h" |
[email protected] | 08f7101 | 2014-07-25 10:27:54 | [diff] [blame] | 11 | #include "components/content_settings/core/common/content_settings_types.h" |
[email protected] | 8a585cb | 2014-03-21 17:13:52 | [diff] [blame] | 12 | #include "url/gurl.h" |
[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 13 | |
thestig | c91176f4 | 2014-10-28 20:16:35 | [diff] [blame] | 14 | #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 15 | #include "chrome/browser/signin/signin_promo.h" |
| 16 | #endif |
| 17 | |
[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 18 | class Browser; |
| 19 | |
| 20 | namespace content { |
| 21 | class WebContents; |
| 22 | } |
| 23 | |
| 24 | namespace chrome { |
| 25 | |
| 26 | // Sources of requests to show the help tab. |
| 27 | enum HelpSource { |
| 28 | // Keyboard accelerators. |
| 29 | HELP_SOURCE_KEYBOARD, |
| 30 | |
| 31 | // Menus (e.g. wrench menu or Chrome OS system menu). |
| 32 | HELP_SOURCE_MENU, |
| 33 | |
| 34 | // WebUI (the "About" page). |
| 35 | HELP_SOURCE_WEBUI, |
| 36 | }; |
| 37 | |
| 38 | |
| 39 | void ShowBookmarkManager(Browser* browser); |
| 40 | void ShowBookmarkManagerForNode(Browser* browser, int64 node_id); |
| 41 | void ShowHistory(Browser* browser); |
| 42 | void ShowDownloads(Browser* browser); |
[email protected] | bc9833c3 | 2013-02-28 04:05:08 | [diff] [blame] | 43 | void ShowExtensions(Browser* browser, |
| 44 | const std::string& extension_to_highlight); |
[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 45 | void ShowConflicts(Browser* browser); |
[email protected] | cc1569b | 2013-10-28 21:29:10 | [diff] [blame] | 46 | |
| 47 | // ShowFeedbackPage() uses |browser| to determine the URL of the current tab. |
| 48 | // |browser| should be NULL if there are no currently open browser windows. |
[email protected] | 7a19ea2 | 2012-08-02 14:39:39 | [diff] [blame] | 49 | void ShowFeedbackPage(Browser* browser, |
| 50 | const std::string& description_template, |
| 51 | const std::string& category_tag); |
[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 52 | |
| 53 | void ShowHelp(Browser* browser, HelpSource source); |
[email protected] | cc1569b | 2013-10-28 21:29:10 | [diff] [blame] | 54 | void ShowHelpForProfile(Profile* profile, |
| 55 | HostDesktopType host_desktop_type, |
| 56 | HelpSource source); |
[email protected] | 32d162b | 2012-12-03 20:31:08 | [diff] [blame] | 57 | void ShowPolicy(Browser* browser); |
[email protected] | 061f89e | 2013-08-12 04:50:00 | [diff] [blame] | 58 | void ShowSlow(Browser* browser); |
mlerman | e6e040a | 2014-10-31 00:53:21 | [diff] [blame] | 59 | void ShowMemory(Browser* browser); |
[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 60 | |
[email protected] | 8a585cb | 2014-03-21 17:13:52 | [diff] [blame] | 61 | // Constructs a settings GURL for the specified |sub_page|. |
| 62 | GURL GetSettingsUrl(const std::string& sub_page); |
| 63 | |
rfrappier | c54c6ea | 2015-07-06 22:52:11 | [diff] [blame] | 64 | // Returns true if |url| is the URL for the settings subpage |sub_page|. |
| 65 | bool IsSettingsSubPage(const GURL& url, const std::string& sub_page); |
| 66 | |
[email protected] | 5f3be2b6a | 2014-04-18 22:27:39 | [diff] [blame] | 67 | // Returns true if |browser| is a trusted popup window containing a page with |
| 68 | // matching |scheme| (or any trusted popup if |scheme| is empty). |
| 69 | bool IsTrustedPopupWindowWithScheme(const Browser* browser, |
| 70 | const std::string& scheme); |
| 71 | |
rfrappier | c54c6ea | 2015-07-06 22:52:11 | [diff] [blame] | 72 | |
[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 73 | // Various things that open in a settings UI. |
| 74 | void ShowSettings(Browser* browser); |
| 75 | void ShowSettingsSubPage(Browser* browser, const std::string& sub_page); |
[email protected] | 8a585cb | 2014-03-21 17:13:52 | [diff] [blame] | 76 | void ShowSettingsSubPageForProfile(Profile* profile, |
| 77 | const std::string& sub_page); |
msramek | b5e676b9 | 2015-08-03 11:11:44 | [diff] [blame] | 78 | void ShowContentSettingsExceptions(Browser* browser, |
| 79 | ContentSettingsType content_settings_type); |
[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 80 | void ShowContentSettings(Browser* browser, |
| 81 | ContentSettingsType content_settings_type); |
[email protected] | 8a585cb | 2014-03-21 17:13:52 | [diff] [blame] | 82 | void ShowSettingsSubPageInTabbedBrowser(Browser* browser, |
| 83 | const std::string& sub_page); |
[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 84 | void ShowClearBrowsingDataDialog(Browser* browser); |
| 85 | void ShowPasswordManager(Browser* browser); |
| 86 | void ShowImportDialog(Browser* browser); |
[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 87 | void ShowAboutChrome(Browser* browser); |
| 88 | void ShowSearchEngineSettings(Browser* browser); |
thestig | c91176f4 | 2014-10-28 20:16:35 | [diff] [blame] | 89 | |
| 90 | #if !defined(OS_ANDROID) && !defined(OS_IOS) |
rockot | b2fdf0b | 2015-01-23 03:42:35 | [diff] [blame] | 91 | // Initiates signin in a new browser tab. |
noms | 5fb66fe | 2014-12-17 23:01:10 | [diff] [blame] | 92 | void ShowBrowserSignin(Browser* browser, signin_metrics::Source source); |
rockot | b2fdf0b | 2015-01-23 03:42:35 | [diff] [blame] | 93 | |
| 94 | // If the user is already signed in, shows the "Signin" portion of Settings, |
| 95 | // otherwise initiates signin in a new browser tab. |
| 96 | void ShowBrowserSigninOrSettings(Browser* browser, |
| 97 | signin_metrics::Source source); |
thestig | c91176f4 | 2014-10-28 20:16:35 | [diff] [blame] | 98 | #endif |
[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 99 | |
[email protected] | 5d9cace7 | 2012-06-21 16:07:12 | [diff] [blame] | 100 | } // namespace chrome |
| 101 | |
| 102 | #endif // CHROME_BROWSER_UI_CHROME_PAGES_H_ |