OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER); | 1050 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER); |
1051 | 1051 |
1052 base::TimeDelta last_synced = base::Time::Now() - last_synced_time_; | 1052 base::TimeDelta last_synced = base::Time::Now() - last_synced_time_; |
1053 | 1053 |
1054 if (last_synced < base::TimeDelta::FromMinutes(1)) | 1054 if (last_synced < base::TimeDelta::FromMinutes(1)) |
1055 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW); | 1055 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW); |
1056 | 1056 |
1057 return TimeFormat::TimeElapsed(last_synced); | 1057 return TimeFormat::TimeElapsed(last_synced); |
1058 } | 1058 } |
1059 | 1059 |
1060 string16 ProfileSyncService::GetAuthenticatedUsername() const { | |
1061 if (backend_.get() && backend_initialized_) | |
1062 return backend_->GetAuthenticatedUsername(); | |
1063 else | |
1064 return string16(); | |
1065 } | |
1066 | |
1067 void ProfileSyncService::OnUserSubmittedAuth( | 1060 void ProfileSyncService::OnUserSubmittedAuth( |
1068 const std::string& username, const std::string& password, | 1061 const std::string& username, const std::string& password, |
1069 const std::string& captcha, const std::string& access_code) { | 1062 const std::string& captcha, const std::string& access_code) { |
1070 last_attempted_user_email_ = username; | 1063 last_attempted_user_email_ = username; |
1071 is_auth_in_progress_ = true; | 1064 is_auth_in_progress_ = true; |
1072 NotifyObservers(); | 1065 NotifyObservers(); |
1073 | 1066 |
1074 auth_start_time_ = base::TimeTicks::Now(); | 1067 auth_start_time_ = base::TimeTicks::Now(); |
1075 | 1068 |
1076 if (!signin_->IsInitialized()) { | 1069 if (!signin_->IsInitialized()) { |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1557 << "Unrecoverable error."; | 1550 << "Unrecoverable error."; |
1558 } else { | 1551 } else { |
1559 DVLOG(0) << "ConfigureDataTypeManager not invoked because backend is not " | 1552 DVLOG(0) << "ConfigureDataTypeManager not invoked because backend is not " |
1560 << "initialized"; | 1553 << "initialized"; |
1561 } | 1554 } |
1562 } | 1555 } |
1563 | 1556 |
1564 const FailedDatatypesHandler& ProfileSyncService::failed_datatypes_handler() { | 1557 const FailedDatatypesHandler& ProfileSyncService::failed_datatypes_handler() { |
1565 return failed_datatypes_handler_; | 1558 return failed_datatypes_handler_; |
1566 } | 1559 } |
OLD | NEW |