| 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 CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "chrome/browser/extensions/api/identity/extension_token_key.h" | 19 #include "chrome/browser/extensions/api/identity/extension_token_key.h" |
| 20 #include "chrome/browser/extensions/api/identity/gaia_web_auth_flow.h" | 20 #include "chrome/browser/extensions/api/identity/gaia_web_auth_flow.h" |
| 21 #include "chrome/browser/extensions/api/identity/identity_get_profile_user_info_
function.h" |
| 21 #include "chrome/browser/extensions/api/identity/identity_launch_web_auth_flow_f
unction.h" | 22 #include "chrome/browser/extensions/api/identity/identity_launch_web_auth_flow_f
unction.h" |
| 22 #include "chrome/browser/extensions/api/identity/identity_mint_queue.h" | 23 #include "chrome/browser/extensions/api/identity/identity_mint_queue.h" |
| 23 #include "chrome/browser/extensions/api/identity/identity_remove_cached_auth_tok
en_function.h" | 24 #include "chrome/browser/extensions/api/identity/identity_remove_cached_auth_tok
en_function.h" |
| 24 #include "chrome/browser/extensions/api/identity/identity_signin_flow.h" | 25 #include "chrome/browser/extensions/api/identity/identity_signin_flow.h" |
| 25 #include "chrome/browser/extensions/api/identity/web_auth_flow.h" | 26 #include "chrome/browser/extensions/api/identity/web_auth_flow.h" |
| 26 #include "chrome/browser/extensions/chrome_extension_function.h" | 27 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 27 #include "components/signin/core/browser/profile_identity_provider.h" | 28 #include "components/signin/core/browser/profile_identity_provider.h" |
| 28 #include "extensions/browser/browser_context_keyed_api_factory.h" | 29 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 29 #include "google_apis/gaia/account_tracker.h" | 30 #include "google_apis/gaia/account_tracker.h" |
| 30 #include "google_apis/gaia/oauth2_mint_token_flow.h" | 31 #include "google_apis/gaia/oauth2_mint_token_flow.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 285 |
| 285 std::unique_ptr<ExtensionTokenKey> token_key_; | 286 std::unique_ptr<ExtensionTokenKey> token_key_; |
| 286 std::string oauth2_client_id_; | 287 std::string oauth2_client_id_; |
| 287 // When launched in interactive mode, and if there is no existing grant, | 288 // When launched in interactive mode, and if there is no existing grant, |
| 288 // a permissions prompt will be popped up to the user. | 289 // a permissions prompt will be popped up to the user. |
| 289 IssueAdviceInfo issue_advice_; | 290 IssueAdviceInfo issue_advice_; |
| 290 std::unique_ptr<GaiaWebAuthFlow> gaia_web_auth_flow_; | 291 std::unique_ptr<GaiaWebAuthFlow> gaia_web_auth_flow_; |
| 291 std::unique_ptr<IdentitySigninFlow> signin_flow_; | 292 std::unique_ptr<IdentitySigninFlow> signin_flow_; |
| 292 }; | 293 }; |
| 293 | 294 |
| 294 class IdentityGetProfileUserInfoFunction | |
| 295 : public ChromeUIThreadExtensionFunction { | |
| 296 public: | |
| 297 DECLARE_EXTENSION_FUNCTION("identity.getProfileUserInfo", | |
| 298 IDENTITY_GETPROFILEUSERINFO); | |
| 299 | |
| 300 IdentityGetProfileUserInfoFunction(); | |
| 301 | |
| 302 private: | |
| 303 ~IdentityGetProfileUserInfoFunction() override; | |
| 304 | |
| 305 // UIThreadExtensionFunction implementation. | |
| 306 ExtensionFunction::ResponseAction Run() override; | |
| 307 }; | |
| 308 | |
| 309 } // namespace extensions | 295 } // namespace extensions |
| 310 | 296 |
| 311 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ | 297 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ |
| OLD | NEW |