Commit 1beecfed authored by David Roger's avatar David Roger Committed by Commit Bot

[signin] Delete GetSigninErrorController from profile_state

This function was just a straight wrapper around the
SigninErrorControllerFactory but is not defined on ChromeOS. This does
not seem very valuable.

Moreover, it was only used from AvatarButtonErrorController.
And since AvatarButtonErrorController will be needed on ChromeOS, there is
no point in keeping this wrapper.

Bug: 1041472
Change-Id: If6f7e84dc9250e3d542206022a20620235eb885a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2093597Reviewed-by: default avatarMonica Basta <msalama@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748688}
parent 390d3bda
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include <algorithm> #include <algorithm>
#include "chrome/browser/profiles/gaia_info_update_service.h" #include "chrome/browser/profiles/gaia_info_update_service.h"
#include "chrome/browser/profiles/gaia_info_update_service_factory.h" #include "chrome/browser/profiles/gaia_info_update_service_factory.h"
#include "chrome/browser/signin/signin_error_controller_factory.h"
#include "components/signin/public/base/signin_pref_names.h" #include "components/signin/public/base/signin_pref_names.h"
#endif #endif
...@@ -190,10 +189,6 @@ void UpdateGaiaProfileInfoIfNeeded(Profile* profile) { ...@@ -190,10 +189,6 @@ void UpdateGaiaProfileInfoIfNeeded(Profile* profile) {
service->Update(); service->Update();
} }
SigninErrorController* GetSigninErrorController(Profile* profile) {
return SigninErrorControllerFactory::GetForProfile(profile);
}
bool SetActiveProfileToGuestIfLocked() { bool SetActiveProfileToGuestIfLocked() {
ProfileManager* profile_manager = g_browser_process->profile_manager(); ProfileManager* profile_manager = g_browser_process->profile_manager();
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
class Browser; class Browser;
class PrefRegistrySimple; class PrefRegistrySimple;
class Profile; class Profile;
class SigninErrorController;
namespace base { class FilePath; } namespace base { class FilePath; }
...@@ -87,11 +86,6 @@ void UpdateIsProfileLockEnabledIfNeeded(Profile* profile); ...@@ -87,11 +86,6 @@ void UpdateIsProfileLockEnabledIfNeeded(Profile* profile);
// profile info. // profile info.
void UpdateGaiaProfileInfoIfNeeded(Profile* profile); void UpdateGaiaProfileInfoIfNeeded(Profile* profile);
// Returns the sign-in error controller for the given profile. Some profiles,
// like guest profiles, may not have a controller so this function may return
// NULL.
SigninErrorController* GetSigninErrorController(Profile* profile);
// If the current active profile (given by prefs::kProfileLastUsed) is locked, // If the current active profile (given by prefs::kProfileLastUsed) is locked,
// changes the active profile to the Guest profile. Returns true if the active // changes the active profile to the Guest profile. Returns true if the active
// profile had been Guest before calling or became Guest as a result of this // profile had been Guest before calling or became Guest as a result of this
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profiles_state.h" #include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/signin/signin_error_controller_factory.h"
#include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/sync_ui_util.h" #include "chrome/browser/sync/sync_ui_util.h"
...@@ -39,14 +40,14 @@ AvatarButtonErrorController::SigninErrorObserver::SigninErrorObserver( ...@@ -39,14 +40,14 @@ AvatarButtonErrorController::SigninErrorObserver::SigninErrorObserver(
: profile_(profile), : profile_(profile),
avatar_button_error_controller_(avatar_button_error_controller) { avatar_button_error_controller_(avatar_button_error_controller) {
SigninErrorController* signin_error_controller = SigninErrorController* signin_error_controller =
profiles::GetSigninErrorController(profile_); SigninErrorControllerFactory::GetForProfile(profile_);
if (signin_error_controller) if (signin_error_controller)
signin_error_controller->AddObserver(this); signin_error_controller->AddObserver(this);
} }
AvatarButtonErrorController::SigninErrorObserver::~SigninErrorObserver() { AvatarButtonErrorController::SigninErrorObserver::~SigninErrorObserver() {
SigninErrorController* signin_error_controller = SigninErrorController* signin_error_controller =
profiles::GetSigninErrorController(profile_); SigninErrorControllerFactory::GetForProfile(profile_);
if (signin_error_controller) if (signin_error_controller)
signin_error_controller->RemoveObserver(this); signin_error_controller->RemoveObserver(this);
} }
...@@ -56,8 +57,8 @@ void AvatarButtonErrorController::SigninErrorObserver::OnErrorChanged() { ...@@ -56,8 +57,8 @@ void AvatarButtonErrorController::SigninErrorObserver::OnErrorChanged() {
} }
bool AvatarButtonErrorController::SigninErrorObserver::HasSigninError() { bool AvatarButtonErrorController::SigninErrorObserver::HasSigninError() {
const SigninErrorController* signin_error_controller = SigninErrorController* signin_error_controller =
profiles::GetSigninErrorController(profile_); SigninErrorControllerFactory::GetForProfile(profile_);
return signin_error_controller && signin_error_controller->HasError(); return signin_error_controller && signin_error_controller->HasError();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment