| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 void set_known_machine_id(bool known_machine_id); |
| 79 void set_device_mode(DeviceMode device_mode); |
| 79 | 80 |
| 80 #if defined(OS_CHROMEOS) | 81 #if defined(OS_CHROMEOS) |
| 81 void set_device_status_collector(DeviceStatusCollector* collector); | 82 void set_device_status_collector(DeviceStatusCollector* collector); |
| 82 DeviceStatusCollector* device_status_collector(); | 83 DeviceStatusCollector* device_status_collector(); |
| 83 #endif | 84 #endif |
| 84 | 85 |
| 85 const std::string& device_id() const; | 86 const std::string& device_id() const; |
| 86 const std::string& device_token() const; | 87 const std::string& device_token() const; |
| 87 const std::string& gaia_token() const; | 88 const std::string& gaia_token() const; |
| 88 const std::string& oauth_token() const; | 89 const std::string& oauth_token() const; |
| 89 bool has_auth_token() const; | 90 bool has_auth_token() const; |
| 90 const std::string& machine_id() const; | 91 const std::string& machine_id() const; |
| 91 const std::string& machine_model() const; | 92 const std::string& machine_model() const; |
| 92 enterprise_management::DeviceRegisterRequest_Type | 93 enterprise_management::DeviceRegisterRequest_Type |
| 93 policy_register_type() const; | 94 policy_register_type() const; |
| 94 const std::string& policy_type() const; | 95 const std::string& policy_type() const; |
| 95 bool token_cache_loaded() const; | 96 bool token_cache_loaded() const; |
| 96 const std::string& user_name() const; | 97 const std::string& user_name() const; |
| 97 UserAffiliation user_affiliation() const; | 98 UserAffiliation user_affiliation() const; |
| 98 bool known_machine_id() const; | 99 bool known_machine_id() const; |
| 100 DeviceMode device_mode() const; |
| 99 | 101 |
| 100 void AddObserver(Observer* observer); | 102 void AddObserver(Observer* observer); |
| 101 void RemoveObserver(Observer* observer); | 103 void RemoveObserver(Observer* observer); |
| 102 | 104 |
| 103 void NotifyCredentialsChanged(); | 105 void NotifyCredentialsChanged(); |
| 104 void NotifyDeviceTokenChanged(); | 106 void NotifyDeviceTokenChanged(); |
| 105 | 107 |
| 106 private: | 108 private: |
| 107 CloudPolicyDataStore( | 109 CloudPolicyDataStore( |
| 108 const enterprise_management::DeviceRegisterRequest_Type register_type, | 110 const enterprise_management::DeviceRegisterRequest_Type register_type, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 123 const std::string policy_type_; | 125 const std::string policy_type_; |
| 124 | 126 |
| 125 // Data used for constructiong both register and policy requests. | 127 // Data used for constructiong both register and policy requests. |
| 126 std::string device_id_; | 128 std::string device_id_; |
| 127 std::string machine_model_; | 129 std::string machine_model_; |
| 128 std::string machine_id_; | 130 std::string machine_id_; |
| 129 bool known_machine_id_; | 131 bool known_machine_id_; |
| 130 | 132 |
| 131 bool token_cache_loaded_; | 133 bool token_cache_loaded_; |
| 132 | 134 |
| 135 DeviceMode device_mode_; |
| 136 |
| 133 #if defined(OS_CHROMEOS) | 137 #if defined(OS_CHROMEOS) |
| 134 scoped_ptr<DeviceStatusCollector> device_status_collector_; | 138 scoped_ptr<DeviceStatusCollector> device_status_collector_; |
| 135 #endif | 139 #endif |
| 136 | 140 |
| 137 ObserverList<Observer, true> observer_list_; | 141 ObserverList<Observer, true> observer_list_; |
| 138 | 142 |
| 139 DISALLOW_COPY_AND_ASSIGN(CloudPolicyDataStore); | 143 DISALLOW_COPY_AND_ASSIGN(CloudPolicyDataStore); |
| 140 }; | 144 }; |
| 141 | 145 |
| 142 } // namespace policy | 146 } // namespace policy |
| 143 | 147 |
| 144 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_ | 148 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_ |
| OLD | NEW |