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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 #include "chrome/browser/speech/tts_message_filter.h" | 69 #include "chrome/browser/speech/tts_message_filter.h" |
70 #include "chrome/browser/ssl/ssl_add_certificate.h" | 70 #include "chrome/browser/ssl/ssl_add_certificate.h" |
71 #include "chrome/browser/ssl/ssl_blocking_page.h" | 71 #include "chrome/browser/ssl/ssl_blocking_page.h" |
72 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" | 72 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" |
73 #include "chrome/browser/ssl/ssl_error_handler.h" | 73 #include "chrome/browser/ssl/ssl_error_handler.h" |
74 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" | 74 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" |
75 #include "chrome/browser/tab_contents/tab_util.h" | 75 #include "chrome/browser/tab_contents/tab_util.h" |
76 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" | 76 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" |
77 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 77 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
78 #include "chrome/browser/ui/chrome_select_file_policy.h" | 78 #include "chrome/browser/ui/chrome_select_file_policy.h" |
79 #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h" | |
80 #include "chrome/browser/ui/search/new_tab_page_interceptor_service_factory.h" | |
79 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 81 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
80 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" | 82 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
81 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 83 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
82 #include "chrome/common/chrome_constants.h" | 84 #include "chrome/common/chrome_constants.h" |
83 #include "chrome/common/chrome_paths.h" | 85 #include "chrome/common/chrome_paths.h" |
84 #include "chrome/common/chrome_switches.h" | 86 #include "chrome/common/chrome_switches.h" |
85 #include "chrome/common/env_vars.h" | 87 #include "chrome/common/env_vars.h" |
86 #include "chrome/common/logging_chrome.h" | 88 #include "chrome/common/logging_chrome.h" |
87 #include "chrome/common/pepper_permission_util.h" | 89 #include "chrome/common/pepper_permission_util.h" |
88 #include "chrome/common/pref_names.h" | 90 #include "chrome/common/pref_names.h" |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
967 hosts->push_back(chrome::kChromeUIThumbnailHost2); | 969 hosts->push_back(chrome::kChromeUIThumbnailHost2); |
968 hosts->push_back(chrome::kChromeUIThumbnailListHost); | 970 hosts->push_back(chrome::kChromeUIThumbnailListHost); |
969 } | 971 } |
970 | 972 |
971 net::URLRequestContextGetter* | 973 net::URLRequestContextGetter* |
972 ChromeContentBrowserClient::CreateRequestContext( | 974 ChromeContentBrowserClient::CreateRequestContext( |
973 content::BrowserContext* browser_context, | 975 content::BrowserContext* browser_context, |
974 content::ProtocolHandlerMap* protocol_handlers, | 976 content::ProtocolHandlerMap* protocol_handlers, |
975 content::URLRequestInterceptorScopedVector request_interceptors) { | 977 content::URLRequestInterceptorScopedVector request_interceptors) { |
976 Profile* profile = Profile::FromBrowserContext(browser_context); | 978 Profile* profile = Profile::FromBrowserContext(browser_context); |
979 NewTabPageInterceptorService* service = | |
980 NewTabPageInterceptorServiceFactory::GetForProfile(profile); | |
981 if (service) | |
982 request_interceptors.push_back(service->CreateInterceptor().release()); | |
mmenke
2015/01/22 20:53:50
Is there a reason to prefer this here over Profile
Mathieu
2015/01/22 21:44:22
I'll let kmadhusu comment on whether she considere
mmenke
2015/01/22 21:52:29
That's actually called on the IO thread, so wouldn
kmadhusu
2015/01/23 00:59:32
I didn't try to create an interceptor in ProfileIm
| |
977 return profile->CreateRequestContext(protocol_handlers, | 983 return profile->CreateRequestContext(protocol_handlers, |
978 request_interceptors.Pass()); | 984 request_interceptors.Pass()); |
979 } | 985 } |
980 | 986 |
981 net::URLRequestContextGetter* | 987 net::URLRequestContextGetter* |
982 ChromeContentBrowserClient::CreateRequestContextForStoragePartition( | 988 ChromeContentBrowserClient::CreateRequestContextForStoragePartition( |
983 content::BrowserContext* browser_context, | 989 content::BrowserContext* browser_context, |
984 const base::FilePath& partition_path, | 990 const base::FilePath& partition_path, |
985 bool in_memory, | 991 bool in_memory, |
986 content::ProtocolHandlerMap* protocol_handlers, | 992 content::ProtocolHandlerMap* protocol_handlers, |
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2622 switches::kDisableWebRtcEncryption, | 2628 switches::kDisableWebRtcEncryption, |
2623 }; | 2629 }; |
2624 to_command_line->CopySwitchesFrom(from_command_line, | 2630 to_command_line->CopySwitchesFrom(from_command_line, |
2625 kWebRtcDevSwitchNames, | 2631 kWebRtcDevSwitchNames, |
2626 arraysize(kWebRtcDevSwitchNames)); | 2632 arraysize(kWebRtcDevSwitchNames)); |
2627 } | 2633 } |
2628 } | 2634 } |
2629 #endif // defined(ENABLE_WEBRTC) | 2635 #endif // defined(ENABLE_WEBRTC) |
2630 | 2636 |
2631 } // namespace chrome | 2637 } // namespace chrome |
OLD | NEW |