| Index: chrome/browser/signin/avatar_signin_error_controller.cc
|
| diff --git a/chrome/browser/signin/avatar_signin_error_controller.cc b/chrome/browser/signin/avatar_signin_error_controller.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..03bde47623390573a28b6a7efa32828938c83654
|
| --- /dev/null
|
| +++ b/chrome/browser/signin/avatar_signin_error_controller.cc
|
| @@ -0,0 +1,29 @@
|
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/signin/avatar_signin_error_controller.h"
|
| +
|
| +#include "chrome/browser/profiles/profiles_state.h"
|
| +#include "components/signin/core/browser/signin_error_controller.h"
|
| +
|
| +AvatarSigninErrorController::AvatarSigninErrorController(Profile* profile)
|
| + : profile_(profile), has_error_(false) {
|
| + SigninErrorController* signin_error_controller =
|
| + profiles::GetSigninErrorController(profile_);
|
| + if (signin_error_controller)
|
| + signin_error_controller->AddObserver(this);
|
| +}
|
| +
|
| +AvatarSigninErrorController::~AvatarSigninErrorController() {
|
| + SigninErrorController* signin_error_controller =
|
| + profiles::GetSigninErrorController(profile_);
|
| + if (signin_error_controller)
|
| + signin_error_controller->RemoveObserver(this);
|
| +}
|
| +
|
| +void AvatarSigninErrorController::OnErrorChanged() {
|
| + const SigninErrorController* signin_error_controller =
|
| + profiles::GetSigninErrorController(profile_);
|
| + has_error_ = signin_error_controller && signin_error_controller->HasError();
|
| +}
|
|
|