| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_POLICY_CLOUD_POLICY_SUBSYSTEM_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_SUBSYSTEM_H_ |
| 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_SUBSYSTEM_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_SUBSYSTEM_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/prefs/pref_change_registrar.h" | 10 #include "chrome/browser/prefs/pref_change_registrar.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 private: | 65 private: |
| 66 PolicyNotifier* policy_notifier_; | 66 PolicyNotifier* policy_notifier_; |
| 67 CloudPolicySubsystem::Observer* observer_; | 67 CloudPolicySubsystem::Observer* observer_; |
| 68 DISALLOW_COPY_AND_ASSIGN(ObserverRegistrar); | 68 DISALLOW_COPY_AND_ASSIGN(ObserverRegistrar); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 CloudPolicySubsystem(CloudPolicyDataStore* data_store, | 71 CloudPolicySubsystem(CloudPolicyDataStore* data_store, |
| 72 CloudPolicyCacheBase* policy_cache); | 72 CloudPolicyCacheBase* policy_cache); |
| 73 virtual ~CloudPolicySubsystem(); | 73 virtual ~CloudPolicySubsystem(); |
| 74 | 74 |
| 75 // net::NetworkChangeNotifier::IPAddressObserver: | |
| 76 virtual void OnIPAddressChanged() OVERRIDE; | |
| 77 | |
| 78 // Initializes the subsystem. The first network request will only be made | 75 // Initializes the subsystem. The first network request will only be made |
| 79 // after |delay_milliseconds|. It can be scheduled to be happen earlier by | 76 // after |delay_milliseconds|. It can be scheduled to be happen earlier by |
| 80 // calling |ScheduleInitialization|. | 77 // calling |ScheduleInitialization|. |
| 81 void CompleteInitialization(const char* refresh_pref_name, | 78 void CompleteInitialization(const char* refresh_pref_name, |
| 82 int64 delay_milliseconds); | 79 int64 delay_milliseconds); |
| 83 | 80 |
| 84 // Shuts the subsystem down. This must be called before threading and network | 81 // Shuts the subsystem down. This must be called before threading and network |
| 85 // infrastructure goes away. | 82 // infrastructure goes away. |
| 86 void Shutdown(); | 83 void Shutdown(); |
| 87 | 84 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 return notifier_.get(); | 116 return notifier_.get(); |
| 120 } | 117 } |
| 121 | 118 |
| 122 // Factory methods that may be overridden in tests. | 119 // Factory methods that may be overridden in tests. |
| 123 virtual void CreateDeviceTokenFetcher(); | 120 virtual void CreateDeviceTokenFetcher(); |
| 124 virtual void CreateCloudPolicyController(); | 121 virtual void CreateCloudPolicyController(); |
| 125 | 122 |
| 126 // NotificationObserver overrides. | 123 // NotificationObserver overrides. |
| 127 virtual void Observe(int type, | 124 virtual void Observe(int type, |
| 128 const NotificationSource& source, | 125 const NotificationSource& source, |
| 129 const NotificationDetails& details); | 126 const NotificationDetails& details) OVERRIDE; |
| 127 |
| 128 // net::NetworkChangeNotifier::IPAddressObserver: |
| 129 virtual void OnIPAddressChanged() OVERRIDE; |
| 130 | 130 |
| 131 // Name of the preference to read the refresh rate from. | 131 // Name of the preference to read the refresh rate from. |
| 132 const char* refresh_pref_name_; | 132 const char* refresh_pref_name_; |
| 133 | 133 |
| 134 PrefChangeRegistrar pref_change_registrar_; | 134 PrefChangeRegistrar pref_change_registrar_; |
| 135 | 135 |
| 136 CloudPolicyDataStore* data_store_; | 136 CloudPolicyDataStore* data_store_; |
| 137 | 137 |
| 138 // Cloud policy infrastructure stuff. | 138 // Cloud policy infrastructure stuff. |
| 139 scoped_ptr<PolicyNotifier> notifier_; | 139 scoped_ptr<PolicyNotifier> notifier_; |
| 140 scoped_ptr<DeviceManagementService> device_management_service_; | 140 scoped_ptr<DeviceManagementService> device_management_service_; |
| 141 scoped_ptr<DeviceTokenFetcher> device_token_fetcher_; | 141 scoped_ptr<DeviceTokenFetcher> device_token_fetcher_; |
| 142 scoped_ptr<CloudPolicyCacheBase> cloud_policy_cache_; | 142 scoped_ptr<CloudPolicyCacheBase> cloud_policy_cache_; |
| 143 scoped_ptr<CloudPolicyController> cloud_policy_controller_; | 143 scoped_ptr<CloudPolicyController> cloud_policy_controller_; |
| 144 | 144 |
| 145 std::string device_management_url_; | 145 std::string device_management_url_; |
| 146 | 146 |
| 147 DISALLOW_COPY_AND_ASSIGN(CloudPolicySubsystem); | 147 DISALLOW_COPY_AND_ASSIGN(CloudPolicySubsystem); |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 } // namespace policy | 150 } // namespace policy |
| 151 | 151 |
| 152 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_SUBSYSTEM_H_ | 152 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_SUBSYSTEM_H_ |
| OLD | NEW |