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 COMPONENTS_SIGNIN_CORE_BROWSER_ABOUT_SIGNIN_INTERNALS_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_ABOUT_SIGNIN_INTERNALS_H_ |
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_ABOUT_SIGNIN_INTERNALS_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_ABOUT_SIGNIN_INTERNALS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // notified of all updates that AboutSigninInternals receives. | 54 // notified of all updates that AboutSigninInternals receives. |
55 void AddSigninObserver(Observer* observer); | 55 void AddSigninObserver(Observer* observer); |
56 void RemoveSigninObserver(Observer* observer); | 56 void RemoveSigninObserver(Observer* observer); |
57 | 57 |
58 // Pulls all signin values that have been persisted in the user prefs. | 58 // Pulls all signin values that have been persisted in the user prefs. |
59 void RefreshSigninPrefs(); | 59 void RefreshSigninPrefs(); |
60 | 60 |
61 // SigninManager::SigninDiagnosticsObserver implementation. | 61 // SigninManager::SigninDiagnosticsObserver implementation. |
62 virtual void NotifySigninValueChanged( | 62 virtual void NotifySigninValueChanged( |
63 const signin_internals_util::UntimedSigninStatusField& field, | 63 const signin_internals_util::UntimedSigninStatusField& field, |
64 const std::string& value) OVERRIDE; | 64 const std::string& value) override; |
65 | 65 |
66 virtual void NotifySigninValueChanged( | 66 virtual void NotifySigninValueChanged( |
67 const signin_internals_util::TimedSigninStatusField& field, | 67 const signin_internals_util::TimedSigninStatusField& field, |
68 const std::string& value) OVERRIDE; | 68 const std::string& value) override; |
69 | 69 |
70 void Initialize(SigninClient* client); | 70 void Initialize(SigninClient* client); |
71 | 71 |
72 // KeyedService implementation. | 72 // KeyedService implementation. |
73 virtual void Shutdown() OVERRIDE; | 73 virtual void Shutdown() override; |
74 | 74 |
75 // Returns a dictionary of values in signin_status_ for use in | 75 // Returns a dictionary of values in signin_status_ for use in |
76 // about:signin-internals. The values are formatted as shown - | 76 // about:signin-internals. The values are formatted as shown - |
77 // | 77 // |
78 // { "signin_info" : | 78 // { "signin_info" : |
79 // [ {"title": "Basic Information", | 79 // [ {"title": "Basic Information", |
80 // "data": [List of {"label" : "foo-field", "value" : "foo"} elems] | 80 // "data": [List of {"label" : "foo-field", "value" : "foo"} elems] |
81 // }, | 81 // }, |
82 // { "title": "Detailed Information", | 82 // { "title": "Detailed Information", |
83 // "data": [List of {"label" : "foo-field", "value" : "foo"} elems] | 83 // "data": [List of {"label" : "foo-field", "value" : "foo"} elems] |
84 // }], | 84 // }], |
85 // "token_info" : | 85 // "token_info" : |
86 // [ List of {"name": "foo-name", "token" : "foo-token", | 86 // [ List of {"name": "foo-name", "token" : "foo-token", |
87 // "status": "foo_stat", "time" : "foo_time"} elems] | 87 // "status": "foo_stat", "time" : "foo_time"} elems] |
88 // } | 88 // } |
89 scoped_ptr<base::DictionaryValue> GetSigninStatus(); | 89 scoped_ptr<base::DictionaryValue> GetSigninStatus(); |
90 | 90 |
91 // Triggers a ListAccounts call to acquire a list of the email addresses | 91 // Triggers a ListAccounts call to acquire a list of the email addresses |
92 // corresponding to the cookies residing on the current cookie jar. | 92 // corresponding to the cookies residing on the current cookie jar. |
93 void GetCookieAccountsAsync(); | 93 void GetCookieAccountsAsync(); |
94 | 94 |
95 // OAuth2TokenService::DiagnosticsObserver implementations. | 95 // OAuth2TokenService::DiagnosticsObserver implementations. |
96 virtual void OnAccessTokenRequested( | 96 virtual void OnAccessTokenRequested( |
97 const std::string& account_id, | 97 const std::string& account_id, |
98 const std::string& consumer_id, | 98 const std::string& consumer_id, |
99 const OAuth2TokenService::ScopeSet& scopes) OVERRIDE; | 99 const OAuth2TokenService::ScopeSet& scopes) override; |
100 virtual void OnFetchAccessTokenComplete( | 100 virtual void OnFetchAccessTokenComplete( |
101 const std::string& account_id, | 101 const std::string& account_id, |
102 const std::string& consumer_id, | 102 const std::string& consumer_id, |
103 const OAuth2TokenService::ScopeSet& scopes, | 103 const OAuth2TokenService::ScopeSet& scopes, |
104 GoogleServiceAuthError error, | 104 GoogleServiceAuthError error, |
105 base::Time expiration_time) OVERRIDE; | 105 base::Time expiration_time) override; |
106 virtual void OnTokenRemoved(const std::string& account_id, | 106 virtual void OnTokenRemoved(const std::string& account_id, |
107 const OAuth2TokenService::ScopeSet& scopes) | 107 const OAuth2TokenService::ScopeSet& scopes) |
108 OVERRIDE; | 108 override; |
109 | 109 |
110 void OnRefreshTokenReceived(std::string status); | 110 void OnRefreshTokenReceived(std::string status); |
111 void OnAuthenticationResultReceived(std::string status); | 111 void OnAuthenticationResultReceived(std::string status); |
112 | 112 |
113 private: | 113 private: |
114 // Encapsulates diagnostic information about tokens for different services. | 114 // Encapsulates diagnostic information about tokens for different services. |
115 struct TokenInfo { | 115 struct TokenInfo { |
116 TokenInfo(const std::string& consumer_id, | 116 TokenInfo(const std::string& consumer_id, |
117 const OAuth2TokenService::ScopeSet& scopes); | 117 const OAuth2TokenService::ScopeSet& scopes); |
118 ~TokenInfo(); | 118 ~TokenInfo(); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // "status" : request status} elems] | 167 // "status" : request status} elems] |
168 // }], | 168 // }], |
169 // } | 169 // } |
170 scoped_ptr<base::DictionaryValue> ToValue(std::string product_version); | 170 scoped_ptr<base::DictionaryValue> ToValue(std::string product_version); |
171 }; | 171 }; |
172 | 172 |
173 void NotifyObservers(); | 173 void NotifyObservers(); |
174 | 174 |
175 | 175 |
176 // Overriden from GaiaAuthConsumer. | 176 // Overriden from GaiaAuthConsumer. |
177 virtual void OnListAccountsSuccess(const std::string& data) OVERRIDE; | 177 virtual void OnListAccountsSuccess(const std::string& data) override; |
178 virtual void OnListAccountsFailure(const GoogleServiceAuthError& error) | 178 virtual void OnListAccountsFailure(const GoogleServiceAuthError& error) |
179 OVERRIDE; | 179 override; |
180 | 180 |
181 // Callback for ListAccounts. Once the email addresses are fetched from GAIA, | 181 // Callback for ListAccounts. Once the email addresses are fetched from GAIA, |
182 // they are pushed to the signin_internals_ui. | 182 // they are pushed to the signin_internals_ui. |
183 void OnListAccountsComplete( | 183 void OnListAccountsComplete( |
184 std::vector<std::pair<std::string, bool> >& gaia_accounts); | 184 std::vector<std::pair<std::string, bool> >& gaia_accounts); |
185 | 185 |
186 // Called when a cookie changes. If the cookie relates to a GAIA LSID cookie, | 186 // Called when a cookie changes. If the cookie relates to a GAIA LSID cookie, |
187 // then we call ListAccounts and update the UI element. | 187 // then we call ListAccounts and update the UI element. |
188 void OnCookieChanged(const net::CanonicalCookie* cookie); | 188 void OnCookieChanged(const net::CanonicalCookie* cookie); |
189 | 189 |
(...skipping 15 matching lines...) Expand all Loading... |
205 | 205 |
206 ObserverList<Observer> signin_observers_; | 206 ObserverList<Observer> signin_observers_; |
207 | 207 |
208 scoped_ptr<SigninClient::CookieChangedCallbackList::Subscription> | 208 scoped_ptr<SigninClient::CookieChangedCallbackList::Subscription> |
209 cookie_changed_subscription_; | 209 cookie_changed_subscription_; |
210 | 210 |
211 DISALLOW_COPY_AND_ASSIGN(AboutSigninInternals); | 211 DISALLOW_COPY_AND_ASSIGN(AboutSigninInternals); |
212 }; | 212 }; |
213 | 213 |
214 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ABOUT_SIGNIN_INTERNALS_H_ | 214 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ABOUT_SIGNIN_INTERNALS_H_ |
OLD | NEW |