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_METRICS_VARIATIONS_RESOURCE_REQUEST_ALLOWED_NOTIFIER_H_ | 5 #ifndef CHROME_BROWSER_METRICS_VARIATIONS_RESOURCE_REQUEST_ALLOWED_NOTIFIER_H_ |
6 #define CHROME_BROWSER_METRICS_VARIATIONS_RESOURCE_REQUEST_ALLOWED_NOTIFIER_H_ | 6 #define CHROME_BROWSER_METRICS_VARIATIONS_RESOURCE_REQUEST_ALLOWED_NOTIFIER_H_ |
7 | 7 |
8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
9 #include "net/base/network_change_notifier.h" | 9 #include "net/base/network_change_notifier.h" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 // global instance. | 34 // global instance. |
35 class ResourceRequestAllowedNotifier : | 35 class ResourceRequestAllowedNotifier : |
36 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
37 public content::NotificationObserver, | 37 public content::NotificationObserver, |
38 #endif | 38 #endif |
39 public net::NetworkChangeNotifier::ConnectionTypeObserver { | 39 public net::NetworkChangeNotifier::ConnectionTypeObserver { |
40 public: | 40 public: |
41 // Observes resource request allowed state changes. | 41 // Observes resource request allowed state changes. |
42 class Observer { | 42 class Observer { |
43 public: | 43 public: |
44 virtual ~Observer() { } | |
45 | |
46 virtual void OnResourceRequestsAllowed() = 0; | 44 virtual void OnResourceRequestsAllowed() = 0; |
47 }; | 45 }; |
48 | 46 |
49 ResourceRequestAllowedNotifier(); | 47 ResourceRequestAllowedNotifier(); |
50 virtual ~ResourceRequestAllowedNotifier(); | 48 virtual ~ResourceRequestAllowedNotifier(); |
51 | 49 |
52 // Sets |observer| as the service to be notified by this instance, and | 50 // Sets |observer| as the service to be notified by this instance, and |
53 // performs initial checks on the criteria. |observer| may not be NULL. | 51 // performs initial checks on the criteria. |observer| may not be NULL. |
54 // This is to be called immediately after construction of an instance of | 52 // This is to be called immediately after construction of an instance of |
55 // ResourceRequestAllowedNotifier to pass it the interested service. | 53 // ResourceRequestAllowedNotifier to pass it the interested service. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 content::NotificationRegistrar registrar_; | 108 content::NotificationRegistrar registrar_; |
111 #endif | 109 #endif |
112 | 110 |
113 // Observing service interested in request permissions. | 111 // Observing service interested in request permissions. |
114 Observer* observer_; | 112 Observer* observer_; |
115 | 113 |
116 DISALLOW_COPY_AND_ASSIGN(ResourceRequestAllowedNotifier); | 114 DISALLOW_COPY_AND_ASSIGN(ResourceRequestAllowedNotifier); |
117 }; | 115 }; |
118 | 116 |
119 #endif // CHROME_BROWSER_METRICS_VARIATIONS_RESOURCE_REQUEST_ALLOWED_NOTIFIER_H
_ | 117 #endif // CHROME_BROWSER_METRICS_VARIATIONS_RESOURCE_REQUEST_ALLOWED_NOTIFIER_H
_ |
OLD | NEW |