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 #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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "chrome/browser/api/prefs/pref_member.h" | 11 #include "chrome/browser/api/prefs/pref_member.h" |
12 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
13 | 13 |
14 namespace chrome_browser_net { | 14 namespace chrome_browser_net { |
15 class Predictor; | 15 class Predictor; |
16 } | 16 } |
17 | 17 |
18 namespace prerender { | 18 namespace prerender { |
19 class PrerenderManager; | 19 class PrerenderManager; |
20 } | 20 } |
21 | 21 |
| 22 class PrefService; |
| 23 |
22 // Monitors network-related preferences for changes and applies them. | 24 // Monitors network-related preferences for changes and applies them. |
23 // The supplied PrefService must outlive this NetPrefObserver. | 25 // The supplied PrefService must outlive this NetPrefObserver. |
24 // Must be used only on the UI thread. | 26 // Must be used only on the UI thread. |
25 class NetPrefObserver : public content::NotificationObserver { | 27 class NetPrefObserver : public content::NotificationObserver { |
26 public: | 28 public: |
27 // |prefs| must be non-NULL and |*prefs| must outlive this. | 29 // |prefs| must be non-NULL and |*prefs| must outlive this. |
28 // |prerender_manager| may be NULL. If not, |*prerender_manager| must | 30 // |prerender_manager| may be NULL. If not, |*prerender_manager| must |
29 // outlive this. | 31 // outlive this. |
30 NetPrefObserver(PrefService* prefs, | 32 NetPrefObserver(PrefService* prefs, |
31 prerender::PrerenderManager* prerender_manager, | 33 prerender::PrerenderManager* prerender_manager, |
(...skipping 13 matching lines...) Expand all Loading... |
45 | 47 |
46 BooleanPrefMember network_prediction_enabled_; | 48 BooleanPrefMember network_prediction_enabled_; |
47 BooleanPrefMember spdy_disabled_; | 49 BooleanPrefMember spdy_disabled_; |
48 prerender::PrerenderManager* prerender_manager_; | 50 prerender::PrerenderManager* prerender_manager_; |
49 chrome_browser_net::Predictor* predictor_; | 51 chrome_browser_net::Predictor* predictor_; |
50 | 52 |
51 DISALLOW_COPY_AND_ASSIGN(NetPrefObserver); | 53 DISALLOW_COPY_AND_ASSIGN(NetPrefObserver); |
52 }; | 54 }; |
53 | 55 |
54 #endif // CHROME_BROWSER_NET_NET_PREF_OBSERVER_H_ | 56 #endif // CHROME_BROWSER_NET_NET_PREF_OBSERVER_H_ |
OLD | NEW |