| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "chrome/browser/extensions/browser_extension_window_controller.h" | 51 #include "chrome/browser/extensions/browser_extension_window_controller.h" |
| 52 #include "chrome/browser/extensions/crx_installer.h" | 52 #include "chrome/browser/extensions/crx_installer.h" |
| 53 #include "chrome/browser/extensions/default_apps_trial.h" | 53 #include "chrome/browser/extensions/default_apps_trial.h" |
| 54 #include "chrome/browser/extensions/extension_prefs.h" | 54 #include "chrome/browser/extensions/extension_prefs.h" |
| 55 #include "chrome/browser/extensions/extension_service.h" | 55 #include "chrome/browser/extensions/extension_service.h" |
| 56 #include "chrome/browser/extensions/extension_tab_helper.h" | 56 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 57 #include "chrome/browser/favicon/favicon_tab_helper.h" | 57 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 58 #include "chrome/browser/file_select_helper.h" | 58 #include "chrome/browser/file_select_helper.h" |
| 59 #include "chrome/browser/first_run/first_run.h" | 59 #include "chrome/browser/first_run/first_run.h" |
| 60 #include "chrome/browser/google/google_url_tracker.h" | 60 #include "chrome/browser/google/google_url_tracker.h" |
| 61 #include "chrome/browser/google/google_util.h" |
| 61 #include "chrome/browser/infobars/infobar_tab_helper.h" | 62 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 62 #include "chrome/browser/instant/instant_controller.h" | 63 #include "chrome/browser/instant/instant_controller.h" |
| 63 #include "chrome/browser/instant/instant_unload_handler.h" | 64 #include "chrome/browser/instant/instant_unload_handler.h" |
| 64 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" | 65 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" |
| 65 #include "chrome/browser/intents/web_intents_util.h" | 66 #include "chrome/browser/intents/web_intents_util.h" |
| 66 #include "chrome/browser/lifetime/application_lifetime.h" | 67 #include "chrome/browser/lifetime/application_lifetime.h" |
| 67 #include "chrome/browser/net/url_fixer_upper.h" | 68 #include "chrome/browser/net/url_fixer_upper.h" |
| 68 #include "chrome/browser/notifications/notification_ui_manager.h" | 69 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 69 #include "chrome/browser/platform_util.h" | 70 #include "chrome/browser/platform_util.h" |
| 70 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 71 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 namespace { | 230 namespace { |
| 230 | 231 |
| 231 // The URL to be loaded to display the "Report a broken page" form. | 232 // The URL to be loaded to display the "Report a broken page" form. |
| 232 const char kBrokenPageUrl[] = | 233 const char kBrokenPageUrl[] = |
| 233 "https://www.google.com/support/chrome/bin/request.py?contact_type=" | 234 "https://www.google.com/support/chrome/bin/request.py?contact_type=" |
| 234 "broken_website&format=inproduct&p.page_title=$1&p.page_url=$2"; | 235 "broken_website&format=inproduct&p.page_title=$1&p.page_url=$2"; |
| 235 | 236 |
| 236 // The URL for the privacy dashboard. | 237 // The URL for the privacy dashboard. |
| 237 const char kPrivacyDashboardUrl[] = "https://www.google.com/dashboard"; | 238 const char kPrivacyDashboardUrl[] = "https://www.google.com/dashboard"; |
| 238 | 239 |
| 240 // The URL for when the user clicks "learn more" on the mixed scripting page |
| 241 // icon bubble. |
| 242 const char kInsecureContentHelpUrl[] = |
| 243 "https://support.google.com/chrome/bin/answer.py?answer=1342714"; |
| 244 |
| 239 // How long we wait before updating the browser chrome while loading a page. | 245 // How long we wait before updating the browser chrome while loading a page. |
| 240 const int kUIUpdateCoalescingTimeMS = 200; | 246 const int kUIUpdateCoalescingTimeMS = 200; |
| 241 | 247 |
| 242 const char kHashMark[] = "#"; | 248 const char kHashMark[] = "#"; |
| 243 | 249 |
| 244 // Returns |true| if entry has an internal chrome:// URL, |false| otherwise. | 250 // Returns |true| if entry has an internal chrome:// URL, |false| otherwise. |
| 245 bool HasInternalURL(const NavigationEntry* entry) { | 251 bool HasInternalURL(const NavigationEntry* entry) { |
| 246 if (!entry) | 252 if (!entry) |
| 247 return false; | 253 return false; |
| 248 | 254 |
| (...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1930 sub_page.substr(loc) : std::string(); | 1936 sub_page.substr(loc) : std::string(); |
| 1931 url = std::string(chrome::kChromeUISettingsURL) + network_page; | 1937 url = std::string(chrome::kChromeUISettingsURL) + network_page; |
| 1932 } | 1938 } |
| 1933 #endif | 1939 #endif |
| 1934 browser::NavigateParams params(GetSingletonTabNavigateParams(GURL(url))); | 1940 browser::NavigateParams params(GetSingletonTabNavigateParams(GURL(url))); |
| 1935 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; | 1941 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; |
| 1936 ShowSingletonTabOverwritingNTP(params); | 1942 ShowSingletonTabOverwritingNTP(params); |
| 1937 } | 1943 } |
| 1938 | 1944 |
| 1939 void Browser::ShowContentSettingsPage(ContentSettingsType content_type) { | 1945 void Browser::ShowContentSettingsPage(ContentSettingsType content_type) { |
| 1940 ShowOptionsTab( | 1946 if (content_type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT) { |
| 1941 chrome::kContentSettingsExceptionsSubPage + std::string(kHashMark) + | 1947 // We don't (yet?) implement user-settable exceptions for mixed script |
| 1942 options2::ContentSettingsHandler::ContentSettingsTypeToGroupName( | 1948 // blocking, so bounce to an explanatory page for now. |
| 1943 content_type)); | 1949 OpenURL(OpenURLParams( |
| 1950 google_util::AppendGoogleLocaleParam(GURL(kInsecureContentHelpUrl)), |
| 1951 Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false)); |
| 1952 } else { |
| 1953 ShowOptionsTab( |
| 1954 chrome::kContentSettingsExceptionsSubPage + std::string(kHashMark) + |
| 1955 options2::ContentSettingsHandler::ContentSettingsTypeToGroupName( |
| 1956 content_type)); |
| 1957 } |
| 1944 } | 1958 } |
| 1945 | 1959 |
| 1946 void Browser::OpenClearBrowsingDataDialog() { | 1960 void Browser::OpenClearBrowsingDataDialog() { |
| 1947 content::RecordAction(UserMetricsAction("ClearBrowsingData_ShowDlg")); | 1961 content::RecordAction(UserMetricsAction("ClearBrowsingData_ShowDlg")); |
| 1948 ShowOptionsTab(chrome::kClearBrowserDataSubPage); | 1962 ShowOptionsTab(chrome::kClearBrowserDataSubPage); |
| 1949 } | 1963 } |
| 1950 | 1964 |
| 1951 void Browser::OpenOptionsDialog() { | 1965 void Browser::OpenOptionsDialog() { |
| 1952 content::RecordAction(UserMetricsAction("ShowOptions")); | 1966 content::RecordAction(UserMetricsAction("ShowOptions")); |
| 1953 ShowOptionsTab(std::string()); | 1967 ShowOptionsTab(std::string()); |
| (...skipping 3276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5230 if (contents && !allow_js_access) { | 5244 if (contents && !allow_js_access) { |
| 5231 contents->web_contents()->GetController().LoadURL( | 5245 contents->web_contents()->GetController().LoadURL( |
| 5232 target_url, | 5246 target_url, |
| 5233 content::Referrer(), | 5247 content::Referrer(), |
| 5234 content::PAGE_TRANSITION_LINK, | 5248 content::PAGE_TRANSITION_LINK, |
| 5235 std::string()); // No extra headers. | 5249 std::string()); // No extra headers. |
| 5236 } | 5250 } |
| 5237 | 5251 |
| 5238 return contents != NULL; | 5252 return contents != NULL; |
| 5239 } | 5253 } |
| OLD | NEW |