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 #include "extensions/shell/browser/api/identity/identity_api.h" | 5 #include "extensions/shell/browser/api/identity/identity_api.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/guid.h" | 10 #include "base/guid.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 IdentityAPI::~IdentityAPI() { | 35 IdentityAPI::~IdentityAPI() { |
36 } | 36 } |
37 | 37 |
38 // static | 38 // static |
39 IdentityAPI* IdentityAPI::Get(content::BrowserContext* context) { | 39 IdentityAPI* IdentityAPI::Get(content::BrowserContext* context) { |
40 return BrowserContextKeyedAPIFactory<IdentityAPI>::Get(context); | 40 return BrowserContextKeyedAPIFactory<IdentityAPI>::Get(context); |
41 } | 41 } |
42 | 42 |
43 // static | 43 // static |
44 BrowserContextKeyedAPIFactory<IdentityAPI>* IdentityAPI::GetFactoryInstance() { | 44 BrowserContextKeyedAPIFactory<IdentityAPI>* IdentityAPI::GetFactoryInstance() { |
45 static base::LazyInstance<BrowserContextKeyedAPIFactory<IdentityAPI>> | 45 static base::LazyInstance< |
46 factory = LAZY_INSTANCE_INITIALIZER; | 46 BrowserContextKeyedAPIFactory<IdentityAPI>>::DestructorAtExit factory = |
| 47 LAZY_INSTANCE_INITIALIZER; |
47 return factory.Pointer(); | 48 return factory.Pointer(); |
48 } | 49 } |
49 | 50 |
50 /////////////////////////////////////////////////////////////////////////////// | 51 /////////////////////////////////////////////////////////////////////////////// |
51 | 52 |
52 IdentityGetAuthTokenFunction::IdentityGetAuthTokenFunction() | 53 IdentityGetAuthTokenFunction::IdentityGetAuthTokenFunction() |
53 : OAuth2TokenService::Consumer(kIdentityApiId) { | 54 : OAuth2TokenService::Consumer(kIdentityApiId) { |
54 } | 55 } |
55 | 56 |
56 IdentityGetAuthTokenFunction::~IdentityGetAuthTokenFunction() { | 57 IdentityGetAuthTokenFunction::~IdentityGetAuthTokenFunction() { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 std::unique_ptr<api::identity::RemoveCachedAuthToken::Params> params( | 157 std::unique_ptr<api::identity::RemoveCachedAuthToken::Params> params( |
157 api::identity::RemoveCachedAuthToken::Params::Create(*args_)); | 158 api::identity::RemoveCachedAuthToken::Params::Create(*args_)); |
158 EXTENSION_FUNCTION_VALIDATE(params.get()); | 159 EXTENSION_FUNCTION_VALIDATE(params.get()); |
159 // This stub identity API does not maintain a token cache, so there is nothing | 160 // This stub identity API does not maintain a token cache, so there is nothing |
160 // to remove. | 161 // to remove. |
161 return RespondNow(NoArguments()); | 162 return RespondNow(NoArguments()); |
162 } | 163 } |
163 | 164 |
164 } // namespace shell | 165 } // namespace shell |
165 } // namespace extensions | 166 } // namespace extensions |
OLD | NEW |