Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 845973005: [New Tab Page] Change the mechanism to intercept online NTP errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 30 matching lines...) Expand all
41 #include "chrome/browser/net/chrome_network_delegate.h" 41 #include "chrome/browser/net/chrome_network_delegate.h"
42 #include "chrome/browser/net/chrome_url_request_context_getter.h" 42 #include "chrome/browser/net/chrome_url_request_context_getter.h"
43 #include "chrome/browser/net/cookie_store_util.h" 43 #include "chrome/browser/net/cookie_store_util.h"
44 #include "chrome/browser/net/proxy_service_factory.h" 44 #include "chrome/browser/net/proxy_service_factory.h"
45 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" 45 #include "chrome/browser/net/resource_prefetch_predictor_observer.h"
46 #include "chrome/browser/predictors/resource_prefetch_predictor.h" 46 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
47 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" 47 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
48 #include "chrome/browser/profiles/profile.h" 48 #include "chrome/browser/profiles/profile.h"
49 #include "chrome/browser/profiles/profile_manager.h" 49 #include "chrome/browser/profiles/profile_manager.h"
50 #include "chrome/browser/signin/signin_names_io_thread.h" 50 #include "chrome/browser/signin/signin_names_io_thread.h"
51 #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h"
52 #include "chrome/browser/ui/search/new_tab_page_interceptor_service_factory.h"
51 #include "chrome/common/chrome_paths.h" 53 #include "chrome/common/chrome_paths.h"
52 #include "chrome/common/chrome_switches.h" 54 #include "chrome/common/chrome_switches.h"
53 #include "chrome/common/pref_names.h" 55 #include "chrome/common/pref_names.h"
54 #include "chrome/common/url_constants.h" 56 #include "chrome/common/url_constants.h"
55 #include "components/content_settings/core/browser/content_settings_provider.h" 57 #include "components/content_settings/core/browser/content_settings_provider.h"
56 #include "components/content_settings/core/browser/host_content_settings_map.h" 58 #include "components/content_settings/core/browser/host_content_settings_map.h"
57 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h" 59 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h"
58 #include "components/dom_distiller/core/url_constants.h" 60 #include "components/dom_distiller/core/url_constants.h"
59 #include "components/startup_metric_utils/startup_metric_utils.h" 61 #include "components/startup_metric_utils/startup_metric_utils.h"
60 #include "components/sync_driver/pref_names.h" 62 #include "components/sync_driver/pref_names.h"
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 ProtocolHandlerRegistry* protocol_handler_registry = 393 ProtocolHandlerRegistry* protocol_handler_registry =
392 ProtocolHandlerRegistryFactory::GetForBrowserContext(profile); 394 ProtocolHandlerRegistryFactory::GetForBrowserContext(profile);
393 DCHECK(protocol_handler_registry); 395 DCHECK(protocol_handler_registry);
394 396
395 // The profile instance is only available here in the InitializeOnUIThread 397 // The profile instance is only available here in the InitializeOnUIThread
396 // method, so we create the url job factory here, then save it for 398 // method, so we create the url job factory here, then save it for
397 // later delivery to the job factory in Init(). 399 // later delivery to the job factory in Init().
398 params->protocol_handler_interceptor = 400 params->protocol_handler_interceptor =
399 protocol_handler_registry->CreateJobInterceptorFactory(); 401 protocol_handler_registry->CreateJobInterceptorFactory();
400 402
403 NewTabPageInterceptorService* new_tab_interceptor_service =
404 NewTabPageInterceptorServiceFactory::GetForProfile(profile);
405 if (new_tab_interceptor_service) {
406 params->new_tab_page_interceptor =
407 new_tab_interceptor_service->CreateInterceptor();
408 }
409
401 params->proxy_config_service 410 params->proxy_config_service
402 .reset(ProxyServiceFactory::CreateProxyConfigService( 411 .reset(ProxyServiceFactory::CreateProxyConfigService(
403 profile->GetProxyConfigTracker())); 412 profile->GetProxyConfigTracker()));
404 #if defined(ENABLE_SUPERVISED_USERS) 413 #if defined(ENABLE_SUPERVISED_USERS)
405 SupervisedUserService* supervised_user_service = 414 SupervisedUserService* supervised_user_service =
406 SupervisedUserServiceFactory::GetForProfile(profile); 415 SupervisedUserServiceFactory::GetForProfile(profile);
407 params->supervised_user_url_filter = 416 params->supervised_user_url_filter =
408 supervised_user_service->GetURLFilterForIOThread(); 417 supervised_user_service->GetURLFilterForIOThread();
409 #endif 418 #endif
410 #if defined(OS_CHROMEOS) 419 #if defined(OS_CHROMEOS)
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 void ProfileIOData::SetCookieSettingsForTesting( 1340 void ProfileIOData::SetCookieSettingsForTesting(
1332 CookieSettings* cookie_settings) { 1341 CookieSettings* cookie_settings) {
1333 DCHECK(!cookie_settings_.get()); 1342 DCHECK(!cookie_settings_.get());
1334 cookie_settings_ = cookie_settings; 1343 cookie_settings_ = cookie_settings;
1335 } 1344 }
1336 1345
1337 void ProfileIOData::set_signin_names_for_testing( 1346 void ProfileIOData::set_signin_names_for_testing(
1338 SigninNamesOnIOThread* signin_names) { 1347 SigninNamesOnIOThread* signin_names) {
1339 signin_names_.reset(signin_names); 1348 signin_names_.reset(signin_names);
1340 } 1349 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698