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

Side by Side Diff: chrome/browser/net/net_pref_observer.h

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit Created 8 years, 1 month 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 | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_NET_NET_PREF_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_NET_NET_PREF_OBSERVER_H_
6 #define CHROME_BROWSER_NET_NET_PREF_OBSERVER_H_ 6 #define CHROME_BROWSER_NET_NET_PREF_OBSERVER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/prefs/public/pref_observer.h"
9 #include "chrome/browser/api/prefs/pref_member.h" 10 #include "chrome/browser/api/prefs/pref_member.h"
10 #include "content/public/browser/notification_observer.h"
11 11
12 namespace chrome_browser_net { 12 namespace chrome_browser_net {
13 class Predictor; 13 class Predictor;
14 } 14 }
15 15
16 namespace prerender { 16 namespace prerender {
17 class PrerenderManager; 17 class PrerenderManager;
18 } 18 }
19 19
20 class PrefService; 20 class PrefService;
21 21
22 // Monitors network-related preferences for changes and applies them. 22 // Monitors network-related preferences for changes and applies them.
23 // The supplied PrefService must outlive this NetPrefObserver. 23 // The supplied PrefService must outlive this NetPrefObserver.
24 // Must be used only on the UI thread. 24 // Must be used only on the UI thread.
25 class NetPrefObserver : public content::NotificationObserver { 25 class NetPrefObserver : public PrefObserver {
26 public: 26 public:
27 // |prefs| must be non-NULL and |*prefs| must outlive this. 27 // |prefs| must be non-NULL and |*prefs| must outlive this.
28 // |prerender_manager| may be NULL. If not, |*prerender_manager| must 28 // |prerender_manager| may be NULL. If not, |*prerender_manager| must
29 // outlive this. 29 // outlive this.
30 NetPrefObserver(PrefService* prefs, 30 NetPrefObserver(PrefService* prefs,
31 prerender::PrerenderManager* prerender_manager, 31 prerender::PrerenderManager* prerender_manager,
32 chrome_browser_net::Predictor* predictor); 32 chrome_browser_net::Predictor* predictor);
33 virtual ~NetPrefObserver(); 33 virtual ~NetPrefObserver();
34 34
35 // content::NotificationObserver 35 // PrefObserver
36 virtual void Observe(int type, 36 virtual void OnPreferenceChanged(PrefServiceBase* service,
37 const content::NotificationSource& source, 37 const std::string& pref_name) OVERRIDE;
38 const content::NotificationDetails& details) OVERRIDE;
39 38
40 static void RegisterPrefs(PrefService* prefs); 39 static void RegisterPrefs(PrefService* prefs);
41 40
42 private: 41 private:
43 void ApplySettings(); 42 void ApplySettings();
44 43
45 BooleanPrefMember network_prediction_enabled_; 44 BooleanPrefMember network_prediction_enabled_;
46 BooleanPrefMember spdy_disabled_; 45 BooleanPrefMember spdy_disabled_;
47 prerender::PrerenderManager* prerender_manager_; 46 prerender::PrerenderManager* prerender_manager_;
48 chrome_browser_net::Predictor* predictor_; 47 chrome_browser_net::Predictor* predictor_;
49 48
50 DISALLOW_COPY_AND_ASSIGN(NetPrefObserver); 49 DISALLOW_COPY_AND_ASSIGN(NetPrefObserver);
51 }; 50 };
52 51
53 #endif // CHROME_BROWSER_NET_NET_PREF_OBSERVER_H_ 52 #endif // CHROME_BROWSER_NET_NET_PREF_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/net/http_server_properties_manager.cc ('k') | chrome/browser/net/net_pref_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698