| OLD | NEW |
| (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 } |
| OLD | NEW |