Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: chrome/browser/ui/webui/identity_internals_ui.cc

Issue 671653002: Standardize usage of virtual/override/final in chrome/browser/ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 28 matching lines...) Expand all
39 // RevokeToken message parameter offsets. 39 // RevokeToken message parameter offsets.
40 const int kRevokeTokenExtensionOffset = 0; 40 const int kRevokeTokenExtensionOffset = 0;
41 const int kRevokeTokenTokenOffset = 1; 41 const int kRevokeTokenTokenOffset = 1;
42 42
43 class IdentityInternalsTokenRevoker; 43 class IdentityInternalsTokenRevoker;
44 44
45 // Class acting as a controller of the chrome://identity-internals WebUI. 45 // Class acting as a controller of the chrome://identity-internals WebUI.
46 class IdentityInternalsUIMessageHandler : public content::WebUIMessageHandler { 46 class IdentityInternalsUIMessageHandler : public content::WebUIMessageHandler {
47 public: 47 public:
48 IdentityInternalsUIMessageHandler(); 48 IdentityInternalsUIMessageHandler();
49 virtual ~IdentityInternalsUIMessageHandler(); 49 ~IdentityInternalsUIMessageHandler() override;
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 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // extension ID. 103 // extension ID.
104 class IdentityInternalsTokenRevoker : public GaiaAuthConsumer { 104 class IdentityInternalsTokenRevoker : public GaiaAuthConsumer {
105 public: 105 public:
106 // Revokes |access_token| from extension with |extension_id|. 106 // Revokes |access_token| from extension with |extension_id|.
107 // |profile| is required for its request context. |consumer| will be 107 // |profile| is required for its request context. |consumer| will be
108 // notified when revocation succeeds via |OnTokenRevokerDone()|. 108 // notified when revocation succeeds via |OnTokenRevokerDone()|.
109 IdentityInternalsTokenRevoker(const std::string& extension_id, 109 IdentityInternalsTokenRevoker(const std::string& extension_id,
110 const std::string& access_token, 110 const std::string& access_token,
111 Profile* profile, 111 Profile* profile,
112 IdentityInternalsUIMessageHandler* consumer); 112 IdentityInternalsUIMessageHandler* consumer);
113 virtual ~IdentityInternalsTokenRevoker(); 113 ~IdentityInternalsTokenRevoker() override;
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 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
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() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698