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

Side by Side Diff: chrome/browser/ui/search/new_tab_page_interceptor_service.h

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, 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_SEARCH_NEW_TAB_PAGE_INTERCEPTOR_SERVICE_H_
6 #define CHROME_BROWSER_UI_SEARCH_NEW_TAB_PAGE_INTERCEPTOR_SERVICE_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h"
11 #include "components/keyed_service/core/keyed_service.h"
12 #include "components/search_engines/template_url_service_observer.h"
13
14 class NewTabPageInterceptor;
15 class Profile;
16 class TemplateURLService;
17
18 namespace net {
19 class URLRequestInterceptor;
20 }
21
22 // Owns a NewTabPageInterceptor.
23 class NewTabPageInterceptorService : public KeyedService,
24 public TemplateURLServiceObserver {
25 public:
26 explicit NewTabPageInterceptorService(Profile* profile);
27 ~NewTabPageInterceptorService() override;
28
29 // TemplateURLServiceObserver override.
30 void OnTemplateURLServiceChanged() override;
31
32 scoped_ptr<net::URLRequestInterceptor> CreateInterceptor();
33
34 private:
35 Profile* profile_;
36 base::WeakPtr<NewTabPageInterceptor> interceptor_;
37 // The TemplateURLService that we are observing. It will outlive this
38 // NewTabPageInterceptorService due to the dependency declared in
39 // NewTabPageInterceptorServiceFactory.
40 TemplateURLService* template_url_service_;
41
42 DISALLOW_COPY_AND_ASSIGN(NewTabPageInterceptorService);
43 };
44
45 #endif // CHROME_BROWSER_UI_SEARCH_NEW_TAB_PAGE_INTERCEPTOR_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698