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

Side by Side Diff: components/signin/core/browser/signin_error_controller.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
OLDNEW
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 "components/signin/core/browser/signin_error_controller.h" 5 #include "components/signin/core/browser/signin_error_controller.h"
6 6
7 #include "components/signin/core/browser/signin_metrics.h" 7 #include "components/signin/core/browser/signin_metrics.h"
8 8
9 namespace { 9 namespace {
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 if (!error_changed && prev_state != GoogleServiceAuthError::NONE) { 85 if (!error_changed && prev_state != GoogleServiceAuthError::NONE) {
86 // No provider reported an error, so clear the error we have now. 86 // No provider reported an error, so clear the error we have now.
87 auth_error_ = GoogleServiceAuthError::AuthErrorNone(); 87 auth_error_ = GoogleServiceAuthError::AuthErrorNone();
88 error_account_id_.clear(); 88 error_account_id_.clear();
89 error_changed = true; 89 error_changed = true;
90 } 90 }
91 91
92 if (error_changed) { 92 if (error_changed) {
93 signin_metrics::LogAuthError(auth_error_.state()); 93 signin_metrics::LogAuthError(auth_error_.state());
94 FOR_EACH_OBSERVER(Observer, observer_list_, OnErrorChanged()); 94 for (auto& observer : observer_list_)
95 observer.OnErrorChanged();
95 } 96 }
96 } 97 }
97 98
98 bool SigninErrorController::HasError() const { 99 bool SigninErrorController::HasError() const {
99 return auth_error_.state() != GoogleServiceAuthError::NONE && 100 return auth_error_.state() != GoogleServiceAuthError::NONE &&
100 auth_error_.state() != GoogleServiceAuthError::CONNECTION_FAILED; 101 auth_error_.state() != GoogleServiceAuthError::CONNECTION_FAILED;
101 } 102 }
102 103
103 void SigninErrorController::AddObserver(Observer* observer) { 104 void SigninErrorController::AddObserver(Observer* observer) {
104 observer_list_.AddObserver(observer); 105 observer_list_.AddObserver(observer);
105 } 106 }
106 107
107 void SigninErrorController::RemoveObserver(Observer* observer) { 108 void SigninErrorController::RemoveObserver(Observer* observer) {
108 observer_list_.RemoveObserver(observer); 109 observer_list_.RemoveObserver(observer);
109 } 110 }
OLDNEW
« no previous file with comments | « components/signin/core/browser/gaia_cookie_manager_service.cc ('k') | components/signin/core/browser/signin_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698