Chromium Code Reviews| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 namespace { | 229 namespace { |
| 230 | 230 |
| 231 // The URL to be loaded to display the "Report a broken page" form. | 231 // The URL to be loaded to display the "Report a broken page" form. |
| 232 const char kBrokenPageUrl[] = | 232 const char kBrokenPageUrl[] = |
| 233 "https://www.google.com/support/chrome/bin/request.py?contact_type=" | 233 "https://www.google.com/support/chrome/bin/request.py?contact_type=" |
| 234 "broken_website&format=inproduct&p.page_title=$1&p.page_url=$2"; | 234 "broken_website&format=inproduct&p.page_title=$1&p.page_url=$2"; |
| 235 | 235 |
| 236 // The URL for the privacy dashboard. | 236 // The URL for the privacy dashboard. |
| 237 const char kPrivacyDashboardUrl[] = "https://www.google.com/dashboard"; | 237 const char kPrivacyDashboardUrl[] = "https://www.google.com/dashboard"; |
| 238 | 238 |
| 239 // The URL for when the user clicks "learn more" on the mixed scripting page | |
| 240 // icon bubble. | |
| 241 const char kInsecureContentHelpUrl[] = | |
| 242 "https://support.google.com/chrome/bin/answer.py?hl=en-US&answer=1342714"; | |
|
Bernhard Bauer
2012/06/20 17:01:43
Please don't hardcode this to an english Help Cent
| |
| 243 | |
| 239 // How long we wait before updating the browser chrome while loading a page. | 244 // How long we wait before updating the browser chrome while loading a page. |
| 240 const int kUIUpdateCoalescingTimeMS = 200; | 245 const int kUIUpdateCoalescingTimeMS = 200; |
| 241 | 246 |
| 242 const char kHashMark[] = "#"; | 247 const char kHashMark[] = "#"; |
| 243 | 248 |
| 244 // Returns |true| if entry has an internal chrome:// URL, |false| otherwise. | 249 // Returns |true| if entry has an internal chrome:// URL, |false| otherwise. |
| 245 bool HasInternalURL(const NavigationEntry* entry) { | 250 bool HasInternalURL(const NavigationEntry* entry) { |
| 246 if (!entry) | 251 if (!entry) |
| 247 return false; | 252 return false; |
| 248 | 253 |
| (...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1930 sub_page.substr(loc) : std::string(); | 1935 sub_page.substr(loc) : std::string(); |
| 1931 url = std::string(chrome::kChromeUISettingsURL) + network_page; | 1936 url = std::string(chrome::kChromeUISettingsURL) + network_page; |
| 1932 } | 1937 } |
| 1933 #endif | 1938 #endif |
| 1934 browser::NavigateParams params(GetSingletonTabNavigateParams(GURL(url))); | 1939 browser::NavigateParams params(GetSingletonTabNavigateParams(GURL(url))); |
| 1935 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; | 1940 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; |
| 1936 ShowSingletonTabOverwritingNTP(params); | 1941 ShowSingletonTabOverwritingNTP(params); |
| 1937 } | 1942 } |
| 1938 | 1943 |
| 1939 void Browser::ShowContentSettingsPage(ContentSettingsType content_type) { | 1944 void Browser::ShowContentSettingsPage(ContentSettingsType content_type) { |
| 1940 ShowOptionsTab( | 1945 if (content_type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT) { |
| 1941 chrome::kContentSettingsExceptionsSubPage + std::string(kHashMark) + | 1946 // We don't (yet?) implment user-settable exceptions for mixed script |
|
Tom Sepez
2012/06/20 04:16:07
nit: implement
| |
| 1942 options2::ContentSettingsHandler::ContentSettingsTypeToGroupName( | 1947 // loading, so bounce to an explanatory page for now. |
|
Tom Sepez
2012/06/20 04:16:07
nit: exceptions are for blocking not loading, eh?
| |
| 1943 content_type)); | 1948 OpenURL(OpenURLParams( |
| 1949 GURL(kInsecureContentHelpUrl), Referrer(), | |
|
Tom Sepez
2012/06/20 04:16:07
Are we sure we want to send a referrer here? SSL
Bernhard Bauer
2012/06/20 17:01:43
I think this sends an empty referrer.
| |
| 1950 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false)); | |
| 1951 } else { | |
| 1952 ShowOptionsTab( | |
| 1953 chrome::kContentSettingsExceptionsSubPage + std::string(kHashMark) + | |
| 1954 options2::ContentSettingsHandler::ContentSettingsTypeToGroupName( | |
| 1955 content_type)); | |
| 1956 } | |
| 1944 } | 1957 } |
| 1945 | 1958 |
| 1946 void Browser::OpenClearBrowsingDataDialog() { | 1959 void Browser::OpenClearBrowsingDataDialog() { |
| 1947 content::RecordAction(UserMetricsAction("ClearBrowsingData_ShowDlg")); | 1960 content::RecordAction(UserMetricsAction("ClearBrowsingData_ShowDlg")); |
| 1948 ShowOptionsTab(chrome::kClearBrowserDataSubPage); | 1961 ShowOptionsTab(chrome::kClearBrowserDataSubPage); |
| 1949 } | 1962 } |
| 1950 | 1963 |
| 1951 void Browser::OpenOptionsDialog() { | 1964 void Browser::OpenOptionsDialog() { |
| 1952 content::RecordAction(UserMetricsAction("ShowOptions")); | 1965 content::RecordAction(UserMetricsAction("ShowOptions")); |
| 1953 ShowOptionsTab(std::string()); | 1966 ShowOptionsTab(std::string()); |
| (...skipping 3276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5230 if (contents && !allow_js_access) { | 5243 if (contents && !allow_js_access) { |
| 5231 contents->web_contents()->GetController().LoadURL( | 5244 contents->web_contents()->GetController().LoadURL( |
| 5232 target_url, | 5245 target_url, |
| 5233 content::Referrer(), | 5246 content::Referrer(), |
| 5234 content::PAGE_TRANSITION_LINK, | 5247 content::PAGE_TRANSITION_LINK, |
| 5235 std::string()); // No extra headers. | 5248 std::string()); // No extra headers. |
| 5236 } | 5249 } |
| 5237 | 5250 |
| 5238 return contents != NULL; | 5251 return contents != NULL; |
| 5239 } | 5252 } |
| OLD | NEW |