| 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_IDENTITY_STRATEGY_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_IDENTITY_STRATEGY_H_ |
| 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_IDENTITY_STRATEGY_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_IDENTITY_STRATEGY_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 // values to the provided pointers. | 68 // values to the provided pointers. |
| 69 virtual bool GetCredentials(std::string* username, | 69 virtual bool GetCredentials(std::string* username, |
| 70 std::string* auth_token) = 0; | 70 std::string* auth_token) = 0; |
| 71 | 71 |
| 72 // Notifies the identity strategy that a new token has been fetched. It is up | 72 // Notifies the identity strategy that a new token has been fetched. It is up |
| 73 // to the identity strategy to store the token, decide whether it is going | 73 // to the identity strategy to store the token, decide whether it is going |
| 74 // to be used, send out an appropriate OnDeviceTokenChanged() notification | 74 // to be used, send out an appropriate OnDeviceTokenChanged() notification |
| 75 // and return the new token in GetDeviceToken() calls. | 75 // and return the new token in GetDeviceToken() calls. |
| 76 virtual void OnDeviceTokenAvailable(const std::string& token) = 0; | 76 virtual void OnDeviceTokenAvailable(const std::string& token) = 0; |
| 77 | 77 |
| 78 // Start loading the token cache. |
| 79 virtual void LoadTokenCache() {} |
| 80 |
| 78 protected: | 81 protected: |
| 79 // Notify observers that the effective token has changed. | 82 // Notify observers that the effective token has changed. |
| 80 void NotifyDeviceTokenChanged(); | 83 void NotifyDeviceTokenChanged(); |
| 81 | 84 |
| 82 // Notify observers about authentication data change. | 85 // Notify observers about authentication data change. |
| 83 void NotifyAuthChanged(); | 86 void NotifyAuthChanged(); |
| 84 | 87 |
| 85 private: | 88 private: |
| 86 ObserverList<Observer, true> observer_list_; | 89 ObserverList<Observer, true> observer_list_; |
| 87 | 90 |
| 88 DISALLOW_COPY_AND_ASSIGN(CloudPolicyIdentityStrategy); | 91 DISALLOW_COPY_AND_ASSIGN(CloudPolicyIdentityStrategy); |
| 89 }; | 92 }; |
| 90 | 93 |
| 91 } // namespace policy | 94 } // namespace policy |
| 92 | 95 |
| 93 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_IDENTITY_STRATEGY_H_ | 96 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_IDENTITY_STRATEGY_H_ |
| OLD | NEW |