| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 EXTENSIONS_SHELL_BROWSER_API_IDENTITY_IDENTITY_API_H_ | 5 #ifndef EXTENSIONS_SHELL_BROWSER_API_IDENTITY_IDENTITY_API_H_ |
| 6 #define EXTENSIONS_SHELL_BROWSER_API_IDENTITY_IDENTITY_API_H_ | 6 #define EXTENSIONS_SHELL_BROWSER_API_IDENTITY_IDENTITY_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 // OAuth2MintTokenFlow::Delegate: | 68 // OAuth2MintTokenFlow::Delegate: |
| 69 void OnMintTokenSuccess(const std::string& access_token, | 69 void OnMintTokenSuccess(const std::string& access_token, |
| 70 int time_to_live) override; | 70 int time_to_live) override; |
| 71 void OnIssueAdviceSuccess(const IssueAdviceInfo& issue_advice) override; | 71 void OnIssueAdviceSuccess(const IssueAdviceInfo& issue_advice) override; |
| 72 void OnMintTokenFailure(const GoogleServiceAuthError& error) override; | 72 void OnMintTokenFailure(const GoogleServiceAuthError& error) override; |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 // A pending token fetch request to get a login-scoped access token for the | 75 // A pending token fetch request to get a login-scoped access token for the |
| 76 // current user for the Chrome project id. | 76 // current user for the Chrome project id. |
| 77 scoped_ptr<OAuth2TokenService::Request> access_token_request_; | 77 std::unique_ptr<OAuth2TokenService::Request> access_token_request_; |
| 78 | 78 |
| 79 // A request for an access token for the current app and its scopes. | 79 // A request for an access token for the current app and its scopes. |
| 80 scoped_ptr<OAuth2MintTokenFlow> mint_token_flow_; | 80 std::unique_ptr<OAuth2MintTokenFlow> mint_token_flow_; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(IdentityGetAuthTokenFunction); | 82 DISALLOW_COPY_AND_ASSIGN(IdentityGetAuthTokenFunction); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 // Stub. See the IDL file for documentation. | 85 // Stub. See the IDL file for documentation. |
| 86 class IdentityRemoveCachedAuthTokenFunction : public UIThreadExtensionFunction { | 86 class IdentityRemoveCachedAuthTokenFunction : public UIThreadExtensionFunction { |
| 87 public: | 87 public: |
| 88 DECLARE_EXTENSION_FUNCTION("identity.removeCachedAuthToken", UNKNOWN) | 88 DECLARE_EXTENSION_FUNCTION("identity.removeCachedAuthToken", UNKNOWN) |
| 89 | 89 |
| 90 IdentityRemoveCachedAuthTokenFunction(); | 90 IdentityRemoveCachedAuthTokenFunction(); |
| 91 | 91 |
| 92 protected: | 92 protected: |
| 93 ~IdentityRemoveCachedAuthTokenFunction() override; | 93 ~IdentityRemoveCachedAuthTokenFunction() override; |
| 94 | 94 |
| 95 // ExtensionFunction: | 95 // ExtensionFunction: |
| 96 ResponseAction Run() override; | 96 ResponseAction Run() override; |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 DISALLOW_COPY_AND_ASSIGN(IdentityRemoveCachedAuthTokenFunction); | 99 DISALLOW_COPY_AND_ASSIGN(IdentityRemoveCachedAuthTokenFunction); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace shell | 102 } // namespace shell |
| 103 } // namespace extensions | 103 } // namespace extensions |
| 104 | 104 |
| 105 #endif // EXTENSIONS_SHELL_BROWSER_API_IDENTITY_IDENTITY_API_H_ | 105 #endif // EXTENSIONS_SHELL_BROWSER_API_IDENTITY_IDENTITY_API_H_ |
| OLD | NEW |