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/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 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2254 extra_parts_[i]->OverrideWebkitPrefs(rvh, url, web_prefs); | 2255 extra_parts_[i]->OverrideWebkitPrefs(rvh, url, web_prefs); |
| 2255 } | 2256 } |
| 2256 | 2257 |
| 2257 void ChromeContentBrowserClient::BrowserURLHandlerCreated( | 2258 void ChromeContentBrowserClient::BrowserURLHandlerCreated( |
| 2258 BrowserURLHandler* handler) { | 2259 BrowserURLHandler* handler) { |
| 2259 for (size_t i = 0; i < extra_parts_.size(); ++i) | 2260 for (size_t i = 0; i < extra_parts_.size(); ++i) |
| 2260 extra_parts_[i]->BrowserURLHandlerCreated(handler); | 2261 extra_parts_[i]->BrowserURLHandlerCreated(handler); |
| 2261 | 2262 |
| 2262 // about: handler. Must come before chrome: handler, since it will | 2263 // about: handler. Must come before chrome: handler, since it will |
| 2263 // rewrite about: urls to chrome: URLs and then expect chrome: to | 2264 // rewrite about: urls to chrome: URLs and then expect chrome: to |
| 2264 // actually handle them. | 2265 // actually handle them. Also relies on a preliminary fixup phase. |
| 2266 handler->SetFixupHandler(&FixupBrowserAboutURL); | |
|
msw
2015/02/18 22:01:23
Is it reasonable to just call AddHandlerPair with
Charlie Reis
2015/02/18 22:16:17
I don't think so, since all the handlers added by
| |
| 2265 handler->AddHandlerPair(&WillHandleBrowserAboutURL, | 2267 handler->AddHandlerPair(&WillHandleBrowserAboutURL, |
| 2266 BrowserURLHandler::null_handler()); | 2268 BrowserURLHandler::null_handler()); |
| 2267 | 2269 |
| 2268 #if defined(OS_ANDROID) | 2270 #if defined(OS_ANDROID) |
| 2269 // Handler to rewrite chrome://newtab on Android. | 2271 // Handler to rewrite chrome://newtab on Android. |
| 2270 handler->AddHandlerPair(&chrome::android::HandleAndroidNativePageURL, | 2272 handler->AddHandlerPair(&chrome::android::HandleAndroidNativePageURL, |
| 2271 BrowserURLHandler::null_handler()); | 2273 BrowserURLHandler::null_handler()); |
| 2272 #else | 2274 #else |
| 2273 // Handler to rewrite chrome://newtab for InstantExtended. | 2275 // Handler to rewrite chrome://newtab for InstantExtended. |
| 2274 handler->AddHandlerPair(&chrome::HandleNewTabURLRewrite, | 2276 handler->AddHandlerPair(&chrome::HandleNewTabURLRewrite, |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2625 switches::kDisableWebRtcEncryption, | 2627 switches::kDisableWebRtcEncryption, |
| 2626 }; | 2628 }; |
| 2627 to_command_line->CopySwitchesFrom(from_command_line, | 2629 to_command_line->CopySwitchesFrom(from_command_line, |
| 2628 kWebRtcDevSwitchNames, | 2630 kWebRtcDevSwitchNames, |
| 2629 arraysize(kWebRtcDevSwitchNames)); | 2631 arraysize(kWebRtcDevSwitchNames)); |
| 2630 } | 2632 } |
| 2631 } | 2633 } |
| 2632 #endif // defined(ENABLE_WEBRTC) | 2634 #endif // defined(ENABLE_WEBRTC) |
| 2633 | 2635 |
| 2634 } // namespace chrome | 2636 } // namespace chrome |
| OLD | NEW |