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

Side by Side Diff: chrome/browser/sync/profile_sync_service.cc

Issue 8665011: sync: remove GetAuthenticatedUsername from ProfileSyncService/SyncBackendHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 9 years, 1 month 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) 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 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER); 1042 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER);
1043 1043
1044 base::TimeDelta last_synced = base::Time::Now() - last_synced_time_; 1044 base::TimeDelta last_synced = base::Time::Now() - last_synced_time_;
1045 1045
1046 if (last_synced < base::TimeDelta::FromMinutes(1)) 1046 if (last_synced < base::TimeDelta::FromMinutes(1))
1047 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW); 1047 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW);
1048 1048
1049 return TimeFormat::TimeElapsed(last_synced); 1049 return TimeFormat::TimeElapsed(last_synced);
1050 } 1050 }
1051 1051
1052 string16 ProfileSyncService::GetAuthenticatedUsername() const {
1053 if (backend_.get() && backend_initialized_)
1054 return backend_->GetAuthenticatedUsername();
1055 else
1056 return string16();
1057 }
1058
1059 void ProfileSyncService::OnUserSubmittedAuth( 1052 void ProfileSyncService::OnUserSubmittedAuth(
1060 const std::string& username, const std::string& password, 1053 const std::string& username, const std::string& password,
1061 const std::string& captcha, const std::string& access_code) { 1054 const std::string& captcha, const std::string& access_code) {
1062 last_attempted_user_email_ = username; 1055 last_attempted_user_email_ = username;
1063 is_auth_in_progress_ = true; 1056 is_auth_in_progress_ = true;
1064 NotifyObservers(); 1057 NotifyObservers();
1065 1058
1066 auth_start_time_ = base::TimeTicks::Now(); 1059 auth_start_time_ = base::TimeTicks::Now();
1067 1060
1068 if (!signin_->IsInitialized()) { 1061 if (!signin_->IsInitialized()) {
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 << "Unrecoverable error."; 1542 << "Unrecoverable error.";
1550 } else { 1543 } else {
1551 VLOG(0) << "ConfigureDataTypeManager not invoked because backend is not " 1544 VLOG(0) << "ConfigureDataTypeManager not invoked because backend is not "
1552 << "initialized"; 1545 << "initialized";
1553 } 1546 }
1554 } 1547 }
1555 1548
1556 const FailedDatatypesHandler& ProfileSyncService::failed_datatypes_handler() { 1549 const FailedDatatypesHandler& ProfileSyncService::failed_datatypes_handler() {
1557 return failed_datatypes_handler_; 1550 return failed_datatypes_handler_;
1558 } 1551 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698