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

Side by Side Diff: components/signin/core/browser/about_signin_internals.cc

Issue 479353003: Add IsAuthenticated() method to SigninManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/signin/core/browser/about_signin_internals.h" 5 #include "components/signin/core/browser/about_signin_internals.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/hash.h" 9 #include "base/hash.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 client_->GetPrefs()->SetString(time_pref.c_str(), time_as_str); 158 client_->GetPrefs()->SetString(time_pref.c_str(), time_as_str);
159 159
160 NotifyObservers(); 160 NotifyObservers();
161 } 161 }
162 162
163 void AboutSigninInternals::RefreshSigninPrefs() { 163 void AboutSigninInternals::RefreshSigninPrefs() {
164 // Since the AboutSigninInternals has a dependency on the SigninManager 164 // Since the AboutSigninInternals has a dependency on the SigninManager
165 // (as seen in the AboutSigninInternalsFactory) the SigninManager can have 165 // (as seen in the AboutSigninInternalsFactory) the SigninManager can have
166 // the AuthenticatedUsername set before AboutSigninInternals can observe it. 166 // the AuthenticatedUsername set before AboutSigninInternals can observe it.
167 // For that scenario, read the AuthenticatedUsername if it exists. 167 // For that scenario, read the AuthenticatedUsername if it exists.
168 if (!signin_manager_->GetAuthenticatedUsername().empty()) { 168 if (signin_manager_->IsAuthenticated()) {
169 signin_status_.untimed_signin_fields[USERNAME] = 169 signin_status_.untimed_signin_fields[USERNAME] =
170 signin_manager_->GetAuthenticatedUsername(); 170 signin_manager_->GetAuthenticatedUsername();
171 } 171 }
172 172
173 // Return if no client exists. Can occur in unit tests. 173 // Return if no client exists. Can occur in unit tests.
174 if (!client_) 174 if (!client_)
175 return; 175 return;
176 176
177 PrefService* pref_service = client_->GetPrefs(); 177 PrefService* pref_service = client_->GetPrefs();
178 for (int i = UNTIMED_FIELDS_BEGIN; i < UNTIMED_FIELDS_END; ++i) { 178 for (int i = UNTIMED_FIELDS_BEGIN; i < UNTIMED_FIELDS_END; ++i) {
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 std::sort(it->second.begin(), it->second.end(), TokenInfo::LessThan); 481 std::sort(it->second.begin(), it->second.end(), TokenInfo::LessThan);
482 const std::vector<TokenInfo*>& tokens = it->second; 482 const std::vector<TokenInfo*>& tokens = it->second;
483 for (size_t i = 0; i < tokens.size(); ++i) { 483 for (size_t i = 0; i < tokens.size(); ++i) {
484 base::DictionaryValue* token_info = tokens[i]->ToValue(); 484 base::DictionaryValue* token_info = tokens[i]->ToValue();
485 token_details->Append(token_info); 485 token_details->Append(token_info);
486 } 486 }
487 } 487 }
488 488
489 return signin_status.Pass(); 489 return signin_status.Pass();
490 } 490 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sync_setup_handler.cc ('k') | components/signin/core/browser/account_reconcilor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698