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

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

Issue 1058513002: Add an Accounts in Token Service section to about:signin-internals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase before submit Created 5 years, 8 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
« no previous file with comments | « components/signin/core/browser/about_signin_internals.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c6294facc29ba2b3d73486723c5d7bb63d37404b..81a7e61406634566482e85541d6437d69474d854 100644
--- a/components/signin/core/browser/about_signin_internals.cc
+++ b/components/signin/core/browser/about_signin_internals.cc
@@ -247,6 +247,7 @@ void AboutSigninInternals::NotifyObservers() {
signin_status_.ToValue(account_tracker_,
signin_manager_,
signin_error_controller_,
+ token_service_,
product_version);
// TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is
@@ -264,6 +265,7 @@ scoped_ptr<base::DictionaryValue> AboutSigninInternals::GetSigninStatus() {
return signin_status_.ToValue(account_tracker_,
signin_manager_,
signin_error_controller_,
+ token_service_,
client_->GetProductVersion()).Pass();
}
@@ -419,8 +421,13 @@ AboutSigninInternals::TokenInfo::~TokenInfo() {}
bool AboutSigninInternals::TokenInfo::LessThan(const TokenInfo* a,
const TokenInfo* b) {
- return a->consumer_id < b->consumer_id ||
- (a->consumer_id == b->consumer_id && a->scopes < b->scopes);
+ if (a->request_time == b->request_time) {
+ if (a->consumer_id == b->consumer_id) {
+ return a->scopes < b->scopes;
+ }
+ return a->consumer_id < b->consumer_id;
+ }
+ return a->request_time < b->request_time;
}
void AboutSigninInternals::TokenInfo::Invalidate() { removed_ = true; }
@@ -492,6 +499,7 @@ scoped_ptr<base::DictionaryValue> AboutSigninInternals::SigninStatus::ToValue(
AccountTrackerService* account_tracker,
SigninManagerBase* signin_manager,
SigninErrorController* signin_error_controller,
+ ProfileOAuth2TokenService* token_service,
const std::string& product_version) {
// TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is
// fixed.
@@ -609,5 +617,22 @@ scoped_ptr<base::DictionaryValue> AboutSigninInternals::SigninStatus::ToValue(
}
}
+ base::ListValue* account_info = new base::ListValue();
+ signin_status->Set("accountInfo", account_info);
+ const std::vector<std::string>& accounts_in_token_service =
+ token_service->GetAccounts();
+
+ if(accounts_in_token_service.size() == 0) {
+ base::DictionaryValue* no_token_entry = new base::DictionaryValue();
+ no_token_entry->SetString("accountId", "No token in Token Service.");
+ account_info->Append(no_token_entry);
+ }
+
+ for(const std::string& account_id : accounts_in_token_service) {
+ base::DictionaryValue* entry = new base::DictionaryValue();
+ entry->SetString("accountId", account_id);
+ account_info->Append(entry);
+ }
+
return signin_status.Pass();
}
« no previous file with comments | « components/signin/core/browser/about_signin_internals.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698