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

Side by Side Diff: components/signin/core/browser/about_signin_internals.cc

Issue 2422943002: Remove usage of FOR_EACH_OBSERVER macro in components/signin (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | components/signin/core/browser/account_tracker_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/signin/core/browser/about_signin_internals.h" 5 #include "components/signin/core/browser/about_signin_internals.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 signin_status_.ToValue(account_tracker_, signin_manager_, 275 signin_status_.ToValue(account_tracker_, signin_manager_,
276 signin_error_controller_, token_service_, 276 signin_error_controller_, token_service_,
277 cookie_manager_service_, product_version); 277 cookie_manager_service_, product_version);
278 278
279 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is 279 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is
280 // fixed. 280 // fixed.
281 tracked_objects::ScopedTracker tracking_profile1( 281 tracked_objects::ScopedTracker tracking_profile1(
282 FROM_HERE_WITH_EXPLICIT_FUNCTION( 282 FROM_HERE_WITH_EXPLICIT_FUNCTION(
283 "422460 AboutSigninInternals::NotifyObservers1")); 283 "422460 AboutSigninInternals::NotifyObservers1"));
284 284
285 FOR_EACH_OBSERVER(AboutSigninInternals::Observer, 285 for (auto& observer : signin_observers_)
286 signin_observers_, 286 observer.OnSigninStateChanged(signin_status_value.get());
287 OnSigninStateChanged(signin_status_value.get()));
288 } 287 }
289 288
290 std::unique_ptr<base::DictionaryValue> AboutSigninInternals::GetSigninStatus() { 289 std::unique_ptr<base::DictionaryValue> AboutSigninInternals::GetSigninStatus() {
291 return signin_status_.ToValue( 290 return signin_status_.ToValue(
292 account_tracker_, signin_manager_, signin_error_controller_, 291 account_tracker_, signin_manager_, signin_error_controller_,
293 token_service_, cookie_manager_service_, client_->GetProductVersion()); 292 token_service_, cookie_manager_service_, client_->GetProductVersion());
294 } 293 }
295 294
296 void AboutSigninInternals::OnAccessTokenRequested( 295 void AboutSigninInternals::OnAccessTokenRequested(
297 const std::string& account_id, 296 const std::string& account_id,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 392 }
394 393
395 if (gaia_accounts.size() == 0) { 394 if (gaia_accounts.size() == 0) {
396 AddCookieEntry(cookie_info, 395 AddCookieEntry(cookie_info,
397 "No Accounts Present.", 396 "No Accounts Present.",
398 std::string(), 397 std::string(),
399 std::string()); 398 std::string());
400 } 399 }
401 400
402 // Update the observers that the cookie's accounts are updated. 401 // Update the observers that the cookie's accounts are updated.
403 FOR_EACH_OBSERVER(AboutSigninInternals::Observer, 402 for (auto& observer : signin_observers_)
404 signin_observers_, 403 observer.OnCookieAccountsFetched(&cookie_status);
405 OnCookieAccountsFetched(&cookie_status));
406 } 404 }
407 405
408 AboutSigninInternals::TokenInfo::TokenInfo( 406 AboutSigninInternals::TokenInfo::TokenInfo(
409 const std::string& consumer_id, 407 const std::string& consumer_id,
410 const OAuth2TokenService::ScopeSet& scopes) 408 const OAuth2TokenService::ScopeSet& scopes)
411 : consumer_id(consumer_id), 409 : consumer_id(consumer_id),
412 scopes(scopes), 410 scopes(scopes),
413 request_time(base::Time::Now()), 411 request_time(base::Time::Now()),
414 error(GoogleServiceAuthError::AuthErrorNone()), 412 error(GoogleServiceAuthError::AuthErrorNone()),
415 removed_(false) {} 413 removed_(false) {}
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 } 669 }
672 670
673 for(const std::string& account_id : accounts_in_token_service) { 671 for(const std::string& account_id : accounts_in_token_service) {
674 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue()); 672 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue());
675 entry->SetString("accountId", account_id); 673 entry->SetString("accountId", account_id);
676 account_info->Append(std::move(entry)); 674 account_info->Append(std::move(entry));
677 } 675 }
678 676
679 return signin_status; 677 return signin_status;
680 } 678 }
OLDNEW
« no previous file with comments | « no previous file | components/signin/core/browser/account_tracker_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698