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

Unified Diff: components/signin/core/browser/about_signin_internals.cc

Issue 1025323004: Show SigninErrorController username and status in AboutSigninInternals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: components/signin/core/browser/about_signin_internals.cc
diff --git a/components/signin/core/browser/about_signin_internals.cc b/components/signin/core/browser/about_signin_internals.cc
index a693d5e8004d0fe75ea7daf6f71c7ad3b09e61ad..59604e0bfe7d181e077ed1541db8c44aaca44f26 100644
--- a/components/signin/core/browser/about_signin_internals.cc
+++ b/components/signin/core/browser/about_signin_internals.cc
@@ -134,11 +134,13 @@ void ClearPref(PrefService* prefs, TimedSigninStatusField field) {
AboutSigninInternals::AboutSigninInternals(
ProfileOAuth2TokenService* token_service,
AccountTrackerService* account_tracker,
- SigninManagerBase* signin_manager)
+ SigninManagerBase* signin_manager,
+ SigninErrorController* signin_error_controller)
: token_service_(token_service),
account_tracker_(account_tracker),
signin_manager_(signin_manager),
- client_(NULL) {}
+ client_(NULL),
+ signin_error_controller_(signin_error_controller) {}
AboutSigninInternals::~AboutSigninInternals() {}
@@ -213,6 +215,7 @@ void AboutSigninInternals::Initialize(SigninClient* client) {
"LSID",
base::Bind(&AboutSigninInternals::OnCookieChanged,
base::Unretained(this)));
+ signin_error_controller_->AddObserver(this);
}
void AboutSigninInternals::Shutdown() {
@@ -240,7 +243,9 @@ void AboutSigninInternals::NotifyObservers() {
"422460 AboutSigninInternals::NotifyObservers 0.5"));
scoped_ptr<base::DictionaryValue> signin_status_value =
- signin_status_.ToValue(account_tracker_, signin_manager_,
+ signin_status_.ToValue(account_tracker_,
+ signin_manager_,
+ signin_error_controller_,
product_version);
// TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is
@@ -255,7 +260,9 @@ void AboutSigninInternals::NotifyObservers() {
}
scoped_ptr<base::DictionaryValue> AboutSigninInternals::GetSigninStatus() {
- return signin_status_.ToValue(account_tracker_, signin_manager_,
+ return signin_status_.ToValue(account_tracker_,
+ signin_manager_,
+ signin_error_controller_,
client_->GetProductVersion()).Pass();
}
@@ -328,6 +335,10 @@ void AboutSigninInternals::OnCookieChanged(const net::CanonicalCookie& cookie,
}
}
+void AboutSigninInternals::OnErrorChanged() {
+ NotifyObservers();
+}
+
void AboutSigninInternals::GetCookieAccountsAsync() {
// Don't bother calling /ListAccounts if no one will observe the response.
if (!gaia_fetcher_ && signin_observers_.might_have_observers()) {
@@ -479,6 +490,7 @@ AboutSigninInternals::TokenInfo* AboutSigninInternals::SigninStatus::FindToken(
scoped_ptr<base::DictionaryValue> AboutSigninInternals::SigninStatus::ToValue(
AccountTrackerService* account_tracker,
SigninManagerBase* signin_manager,
+ SigninErrorController* signin_error_controller,
const std::string& product_version) {
// TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is
// fixed.
@@ -524,6 +536,12 @@ scoped_ptr<base::DictionaryValue> AboutSigninInternals::SigninStatus::ToValue(
SigninStatusFieldToLabel(
static_cast<UntimedSigninStatusField>(USERNAME)),
signin_manager->GetAuthenticatedUsername());
+ if (signin_error_controller->HasError()) {
+ AddSectionEntry(basic_info, "ErrorController Username",
+ signin_error_controller->error_username());
+ AddSectionEntry(basic_info, "ErrorController Status",
+ signin_error_controller->auth_error().ToString());
+ }
Roger Tawa OOO till Jul 10th 2015/03/25 15:41:55 If there is no auth error, maybe it should say:
anthonyvd 2015/03/26 15:49:58 Done. Makes sense to be consistent with Signin Sta
}
#if !defined(OS_CHROMEOS)

Powered by Google App Engine
This is Rietveld 408576698