OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/ui/webui/identity_internals_ui.h" | 5 #include "chrome/browser/ui/webui/identity_internals_ui.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 public: | 47 public: |
48 IdentityInternalsUIMessageHandler(); | 48 IdentityInternalsUIMessageHandler(); |
49 virtual ~IdentityInternalsUIMessageHandler(); | 49 virtual ~IdentityInternalsUIMessageHandler(); |
50 | 50 |
51 // Ensures that a proper clean up happens after a token is revoked. That | 51 // Ensures that a proper clean up happens after a token is revoked. That |
52 // includes deleting the |token_revoker|, removing the token from Identity API | 52 // includes deleting the |token_revoker|, removing the token from Identity API |
53 // cache and updating the UI that the token is gone. | 53 // cache and updating the UI that the token is gone. |
54 void OnTokenRevokerDone(IdentityInternalsTokenRevoker* token_revoker); | 54 void OnTokenRevokerDone(IdentityInternalsTokenRevoker* token_revoker); |
55 | 55 |
56 // WebUIMessageHandler implementation. | 56 // WebUIMessageHandler implementation. |
57 virtual void RegisterMessages() OVERRIDE; | 57 virtual void RegisterMessages() override; |
58 | 58 |
59 private: | 59 private: |
60 // Gets the name of an extension referred to by |token_cache_key| as a string. | 60 // Gets the name of an extension referred to by |token_cache_key| as a string. |
61 const std::string GetExtensionName( | 61 const std::string GetExtensionName( |
62 const extensions::ExtensionTokenKey& token_cache_key); | 62 const extensions::ExtensionTokenKey& token_cache_key); |
63 | 63 |
64 // Gets a list of scopes specified in |token_cache_key| and returns a pointer | 64 // Gets a list of scopes specified in |token_cache_key| and returns a pointer |
65 // to a ListValue containing the scopes. The caller gets ownership of the | 65 // to a ListValue containing the scopes. The caller gets ownership of the |
66 // returned object. | 66 // returned object. |
67 base::ListValue* GetScopes( | 67 base::ListValue* GetScopes( |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 IdentityInternalsUIMessageHandler* consumer); | 112 IdentityInternalsUIMessageHandler* consumer); |
113 virtual ~IdentityInternalsTokenRevoker(); | 113 virtual ~IdentityInternalsTokenRevoker(); |
114 | 114 |
115 // Returns the access token being revoked. | 115 // Returns the access token being revoked. |
116 const std::string& access_token() const { return access_token_; } | 116 const std::string& access_token() const { return access_token_; } |
117 | 117 |
118 // Returns the ID of the extension the access token is related to. | 118 // Returns the ID of the extension the access token is related to. |
119 const std::string& extension_id() const { return extension_id_; } | 119 const std::string& extension_id() const { return extension_id_; } |
120 | 120 |
121 // GaiaAuthConsumer implementation. | 121 // GaiaAuthConsumer implementation. |
122 virtual void OnOAuth2RevokeTokenCompleted() OVERRIDE; | 122 virtual void OnOAuth2RevokeTokenCompleted() override; |
123 | 123 |
124 private: | 124 private: |
125 // An object used to start a token revoke request. | 125 // An object used to start a token revoke request. |
126 GaiaAuthFetcher fetcher_; | 126 GaiaAuthFetcher fetcher_; |
127 // An ID of an extension the access token is related to. | 127 // An ID of an extension the access token is related to. |
128 const std::string extension_id_; | 128 const std::string extension_id_; |
129 // The access token to revoke. | 129 // The access token to revoke. |
130 const std::string access_token_; | 130 const std::string access_token_; |
131 // An object that needs to be notified once the access token is revoked. | 131 // An object that needs to be notified once the access token is revoked. |
132 IdentityInternalsUIMessageHandler* consumer_; // weak. | 132 IdentityInternalsUIMessageHandler* consumer_; // weak. |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 html_source->AddResourcePath("identity_internals.js", | 304 html_source->AddResourcePath("identity_internals.js", |
305 IDR_IDENTITY_INTERNALS_JS); | 305 IDR_IDENTITY_INTERNALS_JS); |
306 html_source->SetDefaultResource(IDR_IDENTITY_INTERNALS_HTML); | 306 html_source->SetDefaultResource(IDR_IDENTITY_INTERNALS_HTML); |
307 | 307 |
308 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), html_source); | 308 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), html_source); |
309 | 309 |
310 web_ui->AddMessageHandler(new IdentityInternalsUIMessageHandler()); | 310 web_ui->AddMessageHandler(new IdentityInternalsUIMessageHandler()); |
311 } | 311 } |
312 | 312 |
313 IdentityInternalsUI::~IdentityInternalsUI() {} | 313 IdentityInternalsUI::~IdentityInternalsUI() {} |
OLD | NEW |