| 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 #include "chrome/browser/extensions/api/identity/identity_api.h" | 5 #include "chrome/browser/extensions/api/identity/identity_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 218 } |
| 219 | 219 |
| 220 return gaia_ids; | 220 return gaia_ids; |
| 221 } | 221 } |
| 222 | 222 |
| 223 std::string IdentityAPI::FindAccountKeyByGaiaId(const std::string& gaia_id) { | 223 std::string IdentityAPI::FindAccountKeyByGaiaId(const std::string& gaia_id) { |
| 224 return account_tracker_.FindAccountIdsByGaiaId(gaia_id).account_key; | 224 return account_tracker_.FindAccountIdsByGaiaId(gaia_id).account_key; |
| 225 } | 225 } |
| 226 | 226 |
| 227 void IdentityAPI::Shutdown() { | 227 void IdentityAPI::Shutdown() { |
| 228 FOR_EACH_OBSERVER(ShutdownObserver, shutdown_observer_list_, OnShutdown()); | 228 for (auto& observer : shutdown_observer_list_) |
| 229 observer.OnShutdown(); |
| 229 account_tracker_.RemoveObserver(this); | 230 account_tracker_.RemoveObserver(this); |
| 230 account_tracker_.Shutdown(); | 231 account_tracker_.Shutdown(); |
| 231 } | 232 } |
| 232 | 233 |
| 233 static base::LazyInstance<BrowserContextKeyedAPIFactory<IdentityAPI> > | 234 static base::LazyInstance<BrowserContextKeyedAPIFactory<IdentityAPI> > |
| 234 g_factory = LAZY_INSTANCE_INITIALIZER; | 235 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 235 | 236 |
| 236 // static | 237 // static |
| 237 BrowserContextKeyedAPIFactory<IdentityAPI>* IdentityAPI::GetFactoryInstance() { | 238 BrowserContextKeyedAPIFactory<IdentityAPI>* IdentityAPI::GetFactoryInstance() { |
| 238 return g_factory.Pointer(); | 239 return g_factory.Pointer(); |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { | 1016 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { |
| 1016 SetResult(base::MakeUnique<base::StringValue>(redirect_url.spec())); | 1017 SetResult(base::MakeUnique<base::StringValue>(redirect_url.spec())); |
| 1017 SendResponse(true); | 1018 SendResponse(true); |
| 1018 if (auth_flow_) | 1019 if (auth_flow_) |
| 1019 auth_flow_.release()->DetachDelegateAndDelete(); | 1020 auth_flow_.release()->DetachDelegateAndDelete(); |
| 1020 Release(); // Balanced in RunAsync. | 1021 Release(); // Balanced in RunAsync. |
| 1021 } | 1022 } |
| 1022 } | 1023 } |
| 1023 | 1024 |
| 1024 } // namespace extensions | 1025 } // namespace extensions |
| OLD | NEW |