| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_IDENTITY_INTERNALS_IDENTITY_INTERNALS_TOKEN_REVO
KER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_IDENTITY_INTERNALS_IDENTITY_INTERNALS_TOKEN_REVO
KER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" |
| 12 #include "google_apis/gaia/gaia_auth_fetcher.h" |
| 13 |
| 14 class IdentityInternalsUIHandler; |
| 15 class Profile; |
| 16 |
| 17 // Handles the revoking of an access token and helps performing the clean up |
| 18 // after it is revoked by holding information about the access token and related |
| 19 // extension ID. |
| 20 class IdentityInternalsTokenRevoker : public GaiaAuthConsumer { |
| 21 public: |
| 22 // Revokes |access_token| from extension with |extension_id|. |
| 23 // |profile| is required for its request context. |consumer| will be |
| 24 // notified when revocation succeeds via |OnTokenRevokerDone()|. |
| 25 IdentityInternalsTokenRevoker(const std::string& extension_id, |
| 26 const std::string& access_token, |
| 27 Profile* profile, |
| 28 IdentityInternalsUIHandler* consumer); |
| 29 virtual ~IdentityInternalsTokenRevoker(); |
| 30 |
| 31 // Returns the access token being revoked. |
| 32 const std::string& access_token() const { return access_token_; } |
| 33 |
| 34 // Returns the ID of the extension the access token is related to. |
| 35 const std::string& extension_id() const { return extension_id_; } |
| 36 |
| 37 // GaiaAuthConsumer implementation. |
| 38 virtual void OnOAuth2RevokeTokenCompleted() OVERRIDE; |
| 39 |
| 40 private: |
| 41 // An object used to start a token revoke request. |
| 42 GaiaAuthFetcher fetcher_; |
| 43 |
| 44 // An ID of an extension the access token is related to. |
| 45 const std::string extension_id_; |
| 46 |
| 47 // The access token to revoke. |
| 48 const std::string access_token_; |
| 49 |
| 50 // An object that needs to be notified once the access token is revoked. |
| 51 IdentityInternalsUIHandler* consumer_; // weak. |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(IdentityInternalsTokenRevoker); |
| 54 }; |
| 55 |
| 56 #endif // CHROME_BROWSER_UI_WEBUI_IDENTITY_INTERNALS_IDENTITY_INTERNALS_TOKEN_R
EVOKER_H_ |
| OLD | NEW |