Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: chrome/browser/extensions/api/identity/identity_api.cc

Issue 2422963002: Remove FOR_EACH_OBSERVER macro usage in chrome/browser/extensions (Closed)
Patch Set: extensions Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698