| 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_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 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 const std::string& device_id, | 68 const std::string& device_id, |
| 69 const std::string& user_name, | 69 const std::string& user_name, |
| 70 const std::string& gaia_token, | 70 const std::string& gaia_token, |
| 71 bool token_cache_loaded); | 71 bool token_cache_loaded); |
| 72 | 72 |
| 73 void set_device_id(const std::string& device_id); | 73 void set_device_id(const std::string& device_id); |
| 74 void set_machine_id(const std::string& machine_id); | 74 void set_machine_id(const std::string& machine_id); |
| 75 void set_machine_model(const std::string& machine_model); | 75 void set_machine_model(const std::string& machine_model); |
| 76 void set_user_name(const std::string& user_name); | 76 void set_user_name(const std::string& user_name); |
| 77 void set_user_affiliation(UserAffiliation user_affiliation); | 77 void set_user_affiliation(UserAffiliation user_affiliation); |
| 78 void set_known_machine_id(bool known_machine_id); |
| 78 | 79 |
| 79 #if defined(OS_CHROMEOS) | 80 #if defined(OS_CHROMEOS) |
| 80 void set_device_status_collector(DeviceStatusCollector* collector); | 81 void set_device_status_collector(DeviceStatusCollector* collector); |
| 81 DeviceStatusCollector* device_status_collector(); | 82 DeviceStatusCollector* device_status_collector(); |
| 82 #endif | 83 #endif |
| 83 | 84 |
| 84 const std::string& device_id() const; | 85 const std::string& device_id() const; |
| 85 const std::string& device_token() const; | 86 const std::string& device_token() const; |
| 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 enterprise_management::DeviceRegisterRequest_Type | 92 enterprise_management::DeviceRegisterRequest_Type |
| 92 policy_register_type() const; | 93 policy_register_type() const; |
| 93 const std::string& policy_type() const; | 94 const std::string& policy_type() const; |
| 94 bool token_cache_loaded() const; | 95 bool token_cache_loaded() const; |
| 95 const std::string& user_name() const; | 96 const std::string& user_name() const; |
| 96 UserAffiliation user_affiliation() const; | 97 UserAffiliation user_affiliation() const; |
| 98 bool known_machine_id() const; |
| 97 | 99 |
| 98 void AddObserver(Observer* observer); | 100 void AddObserver(Observer* observer); |
| 99 void RemoveObserver(Observer* observer); | 101 void RemoveObserver(Observer* observer); |
| 100 | 102 |
| 101 void NotifyCredentialsChanged(); | 103 void NotifyCredentialsChanged(); |
| 102 void NotifyDeviceTokenChanged(); | 104 void NotifyDeviceTokenChanged(); |
| 103 | 105 |
| 104 private: | 106 private: |
| 105 CloudPolicyDataStore( | 107 CloudPolicyDataStore( |
| 106 const enterprise_management::DeviceRegisterRequest_Type register_type, | 108 const enterprise_management::DeviceRegisterRequest_Type register_type, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 117 | 119 |
| 118 // Constants that won't change over the life-time of a cloud policy | 120 // Constants that won't change over the life-time of a cloud policy |
| 119 // subsystem. | 121 // subsystem. |
| 120 const enterprise_management::DeviceRegisterRequest_Type policy_register_type_; | 122 const enterprise_management::DeviceRegisterRequest_Type policy_register_type_; |
| 121 const std::string policy_type_; | 123 const std::string policy_type_; |
| 122 | 124 |
| 123 // Data used for constructiong both register and policy requests. | 125 // Data used for constructiong both register and policy requests. |
| 124 std::string device_id_; | 126 std::string device_id_; |
| 125 std::string machine_model_; | 127 std::string machine_model_; |
| 126 std::string machine_id_; | 128 std::string machine_id_; |
| 129 bool known_machine_id_; |
| 127 | 130 |
| 128 bool token_cache_loaded_; | 131 bool token_cache_loaded_; |
| 129 | 132 |
| 130 #if defined(OS_CHROMEOS) | 133 #if defined(OS_CHROMEOS) |
| 131 scoped_ptr<DeviceStatusCollector> device_status_collector_; | 134 scoped_ptr<DeviceStatusCollector> device_status_collector_; |
| 132 #endif | 135 #endif |
| 133 | 136 |
| 134 ObserverList<Observer, true> observer_list_; | 137 ObserverList<Observer, true> observer_list_; |
| 135 | 138 |
| 136 DISALLOW_COPY_AND_ASSIGN(CloudPolicyDataStore); | 139 DISALLOW_COPY_AND_ASSIGN(CloudPolicyDataStore); |
| 137 }; | 140 }; |
| 138 | 141 |
| 139 } // namespace policy | 142 } // namespace policy |
| 140 | 143 |
| 141 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_ | 144 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_ |
| OLD | NEW |