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

Unified 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: moved to profile_io_data Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/browser/search/search.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 271fa2c40abb48fed310d9b1381e1ce73545fe49..5443b011dbde127c33f24d3947c085a52cd873f2 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -48,6 +48,8 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/signin_names_io_thread.h"
+#include "chrome/browser/ui/search/new_tab_page_interceptor_service.h"
+#include "chrome/browser/ui/search/new_tab_page_interceptor_service_factory.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -398,6 +400,13 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
params->protocol_handler_interceptor =
protocol_handler_registry->CreateJobInterceptorFactory();
+ NewTabPageInterceptorService* new_tab_interceptor_service =
+ NewTabPageInterceptorServiceFactory::GetForProfile(profile);
+ if (new_tab_interceptor_service) {
+ params->new_tab_page_interceptor =
+ new_tab_interceptor_service->CreateInterceptor();
+ }
+
params->proxy_config_service
.reset(ProxyServiceFactory::CreateProxyConfigService(
profile->GetProxyConfigTracker()));
@@ -1129,6 +1138,12 @@ void ProfileIOData::Init(
tracked_objects::ScopedTracker tracking_profile5(
FROM_HERE_WITH_EXPLICIT_FUNCTION("436671 ProfileIOData::Init5"));
+ // Install the New Tab Page Interceptor.
+ if (profile_params_->new_tab_page_interceptor.get()) {
+ request_interceptors.push_back(
+ profile_params_->new_tab_page_interceptor.release());
+ }
+
InitializeInternal(
network_delegate.Pass(), profile_params_.get(),
protocol_handlers, request_interceptors.Pass());
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/browser/search/search.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698