| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |