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_DATA_STORE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "chrome/browser/policy/device_status_reporter.h" | |
12 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | 13 #include "chrome/browser/policy/proto/device_management_backend.pb.h" |
13 | 14 |
14 namespace policy { | 15 namespace policy { |
15 | 16 |
16 namespace em = enterprise_management; | 17 namespace em = enterprise_management; |
17 | 18 |
18 // Stores in memory all the data that is used in the cloud policy subsystem, | 19 // Stores in memory all the data that is used in the cloud policy subsystem, |
19 // and manages notification about changes to these fields. | 20 // and manages notification about changes to these fields. |
20 // TODO(gfeher): The policy data stored in CloudPolicyCacheBase is currently | 21 // TODO(gfeher): The policy data stored in CloudPolicyCacheBase is currently |
21 // an exception, move that here. | 22 // an exception, move that here. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 const std::string& gaia_token() const; | 87 const std::string& gaia_token() const; |
87 const std::string& oauth_token() const; | 88 const std::string& oauth_token() const; |
88 bool has_auth_token() const; | 89 bool has_auth_token() const; |
89 const std::string& machine_id() const; | 90 const std::string& machine_id() const; |
90 const std::string& machine_model() const; | 91 const std::string& machine_model() const; |
91 em::DeviceRegisterRequest_Type policy_register_type() const; | 92 em::DeviceRegisterRequest_Type policy_register_type() const; |
92 const std::string& policy_type() const; | 93 const std::string& policy_type() const; |
93 bool token_cache_loaded() const; | 94 bool token_cache_loaded() const; |
94 const std::string& user_name() const; | 95 const std::string& user_name() const; |
95 UserAffiliation user_affiliation() const; | 96 UserAffiliation user_affiliation() const; |
97 DeviceStatusReporter* device_status_reporter(); | |
Mattias Nissler (ping if slow)
2011/11/25 14:15:19
Since this is not actively reporting stuff, maybe
Patrick Dubroy
2011/11/29 18:01:46
Done.
| |
96 | 98 |
97 void AddObserver(Observer* observer); | 99 void AddObserver(Observer* observer); |
98 void RemoveObserver(Observer* observer); | 100 void RemoveObserver(Observer* observer); |
99 | 101 |
100 void NotifyCredentialsChanged(); | 102 void NotifyCredentialsChanged(); |
101 void NotifyDeviceTokenChanged(); | 103 void NotifyDeviceTokenChanged(); |
102 | 104 |
103 private: | 105 private: |
104 CloudPolicyDataStore( | 106 CloudPolicyDataStore( |
105 const em::DeviceRegisterRequest_Type policy_register_type, | 107 const em::DeviceRegisterRequest_Type policy_register_type, |
(...skipping 13 matching lines...) Expand all Loading... | |
119 const em::DeviceRegisterRequest_Type policy_register_type_; | 121 const em::DeviceRegisterRequest_Type policy_register_type_; |
120 const std::string policy_type_; | 122 const std::string policy_type_; |
121 | 123 |
122 // Data used for constructiong both register and policy requests. | 124 // Data used for constructiong both register and policy requests. |
123 std::string device_id_; | 125 std::string device_id_; |
124 std::string machine_model_; | 126 std::string machine_model_; |
125 std::string machine_id_; | 127 std::string machine_id_; |
126 | 128 |
127 bool token_cache_loaded_; | 129 bool token_cache_loaded_; |
128 | 130 |
131 DeviceStatusReporter device_status_reporter_; | |
132 | |
129 ObserverList<Observer, true> observer_list_; | 133 ObserverList<Observer, true> observer_list_; |
130 | 134 |
131 DISALLOW_COPY_AND_ASSIGN(CloudPolicyDataStore); | 135 DISALLOW_COPY_AND_ASSIGN(CloudPolicyDataStore); |
132 }; | 136 }; |
133 | 137 |
134 } // namespace policy | 138 } // namespace policy |
135 | 139 |
136 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_ | 140 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_ |
OLD | NEW |