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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 #include "components/content_settings/core/browser/content_settings_utils.h" | 97 #include "components/content_settings/core/browser/content_settings_utils.h" |
98 #include "components/content_settings/core/browser/host_content_settings_map.h" | 98 #include "components/content_settings/core/browser/host_content_settings_map.h" |
99 #include "components/content_settings/core/common/content_settings.h" | 99 #include "components/content_settings/core/common/content_settings.h" |
100 #include "components/content_settings/core/common/permission_request_id.h" | 100 #include "components/content_settings/core/common/permission_request_id.h" |
101 #include "components/dom_distiller/core/url_constants.h" | 101 #include "components/dom_distiller/core/url_constants.h" |
102 #include "components/google/core/browser/google_util.h" | 102 #include "components/google/core/browser/google_util.h" |
103 #include "components/metrics/client_info.h" | 103 #include "components/metrics/client_info.h" |
104 #include "components/pref_registry/pref_registry_syncable.h" | 104 #include "components/pref_registry/pref_registry_syncable.h" |
105 #include "components/signin/core/common/profile_management_switches.h" | 105 #include "components/signin/core/common/profile_management_switches.h" |
106 #include "components/translate/core/common/translate_switches.h" | 106 #include "components/translate/core/common/translate_switches.h" |
107 #include "components/url_fixer/url_fixer.h" | |
107 #include "content/public/browser/browser_child_process_host.h" | 108 #include "content/public/browser/browser_child_process_host.h" |
108 #include "content/public/browser/browser_main_parts.h" | 109 #include "content/public/browser/browser_main_parts.h" |
109 #include "content/public/browser/browser_ppapi_host.h" | 110 #include "content/public/browser/browser_ppapi_host.h" |
110 #include "content/public/browser/browser_thread.h" | 111 #include "content/public/browser/browser_thread.h" |
111 #include "content/public/browser/browser_url_handler.h" | 112 #include "content/public/browser/browser_url_handler.h" |
112 #include "content/public/browser/child_process_data.h" | 113 #include "content/public/browser/child_process_data.h" |
113 #include "content/public/browser/child_process_security_policy.h" | 114 #include "content/public/browser/child_process_security_policy.h" |
114 #include "content/public/browser/permission_type.h" | 115 #include "content/public/browser/permission_type.h" |
115 #include "content/public/browser/render_frame_host.h" | 116 #include "content/public/browser/render_frame_host.h" |
116 #include "content/public/browser/render_process_host.h" | 117 #include "content/public/browser/render_process_host.h" |
(...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2272 #else | 2273 #else |
2273 // Handler to rewrite chrome://newtab for InstantExtended. | 2274 // Handler to rewrite chrome://newtab for InstantExtended. |
2274 handler->AddHandlerPair(&chrome::HandleNewTabURLRewrite, | 2275 handler->AddHandlerPair(&chrome::HandleNewTabURLRewrite, |
2275 &chrome::HandleNewTabURLReverseRewrite); | 2276 &chrome::HandleNewTabURLReverseRewrite); |
2276 #endif | 2277 #endif |
2277 | 2278 |
2278 // chrome: & friends. | 2279 // chrome: & friends. |
2279 handler->AddHandlerPair(&HandleWebUI, &HandleWebUIReverse); | 2280 handler->AddHandlerPair(&HandleWebUI, &HandleWebUIReverse); |
2280 } | 2281 } |
2281 | 2282 |
2283 GURL ChromeContentBrowserClient::FixupURL(const GURL& url) { | |
2284 // WillHandleBrowserAboutURL calls url_fixer::FixupURL to ensure that about: | |
2285 // URLs are rewritten to chrome:, but that call does other cleanup as well. | |
2286 // Make sure this cleanup happens before the rewriting phase that determines | |
msw
2015/02/17 23:06:41
nit: it's a little presumptuous of this comment to
Charlie Reis
2015/02/17 23:31:48
I can see how it reads that way. Then again, it's
| |
2287 // the virtual URL. | |
2288 return url_fixer::FixupURL(url.possibly_invalid_spec(), std::string()); | |
2289 } | |
2290 | |
2282 void ChromeContentBrowserClient::ClearCache(RenderViewHost* rvh) { | 2291 void ChromeContentBrowserClient::ClearCache(RenderViewHost* rvh) { |
2283 Profile* profile = Profile::FromBrowserContext( | 2292 Profile* profile = Profile::FromBrowserContext( |
2284 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); | 2293 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); |
2285 BrowsingDataRemover* remover = | 2294 BrowsingDataRemover* remover = |
2286 BrowsingDataRemover::CreateForUnboundedRange(profile); | 2295 BrowsingDataRemover::CreateForUnboundedRange(profile); |
2287 remover->Remove(BrowsingDataRemover::REMOVE_CACHE, | 2296 remover->Remove(BrowsingDataRemover::REMOVE_CACHE, |
2288 BrowsingDataHelper::UNPROTECTED_WEB); | 2297 BrowsingDataHelper::UNPROTECTED_WEB); |
2289 // BrowsingDataRemover takes care of deleting itself when done. | 2298 // BrowsingDataRemover takes care of deleting itself when done. |
2290 } | 2299 } |
2291 | 2300 |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2625 switches::kDisableWebRtcEncryption, | 2634 switches::kDisableWebRtcEncryption, |
2626 }; | 2635 }; |
2627 to_command_line->CopySwitchesFrom(from_command_line, | 2636 to_command_line->CopySwitchesFrom(from_command_line, |
2628 kWebRtcDevSwitchNames, | 2637 kWebRtcDevSwitchNames, |
2629 arraysize(kWebRtcDevSwitchNames)); | 2638 arraysize(kWebRtcDevSwitchNames)); |
2630 } | 2639 } |
2631 } | 2640 } |
2632 #endif // defined(ENABLE_WEBRTC) | 2641 #endif // defined(ENABLE_WEBRTC) |
2633 | 2642 |
2634 } // namespace chrome | 2643 } // namespace chrome |
OLD | NEW |