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

Side by Side Diff: chrome/browser/signin/avatar_signin_error_controller.cc

Issue 2179283002: Refactored signin/sync error controllers for the avatar button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made nested classes private Created 4 years, 4 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
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/signin/avatar_signin_error_controller.h"
6
7 #include "chrome/browser/profiles/profiles_state.h"
8 #include "components/signin/core/browser/signin_error_controller.h"
9
10 AvatarSigninErrorController::AvatarSigninErrorController(Profile* profile)
11 : profile_(profile), has_error_(false) {
12 SigninErrorController* signin_error_controller =
13 profiles::GetSigninErrorController(profile_);
14 if (signin_error_controller)
15 signin_error_controller->AddObserver(this);
16 }
17
18 AvatarSigninErrorController::~AvatarSigninErrorController() {
19 SigninErrorController* signin_error_controller =
20 profiles::GetSigninErrorController(profile_);
21 if (signin_error_controller)
22 signin_error_controller->RemoveObserver(this);
23 }
24
25 void AvatarSigninErrorController::OnErrorChanged() {
26 const SigninErrorController* signin_error_controller =
27 profiles::GetSigninErrorController(profile_);
28 has_error_ = signin_error_controller && signin_error_controller->HasError();
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698