summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 20:07:10 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 20:07:10 +0000
commitb42ebf48c6b35de78a2a6891f42ac056a4e87175 (patch)
treed82696c7374d9f2cf101a44adc11dfa137b40abf
parent5b5bb9d530c0085a5b8becad2a2302737e215890 (diff)
downloadchromium_src-b42ebf48c6b35de78a2a6891f42ac056a4e87175.zip
chromium_src-b42ebf48c6b35de78a2a6891f42ac056a4e87175.tar.gz
chromium_src-b42ebf48c6b35de78a2a6891f42ac056a4e87175.tar.bz2
Set username for sync setup on ChromeOS
BUG=http://code.google.com/p/chromium-os/issues/detail?id=8052 TEST=See issue Review URL: http://codereview.chromium.org/4031004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63550 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/sync/sync_setup_flow.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc
index 1dbd60c..08dcfa1 100644
--- a/chrome/browser/sync/sync_setup_flow.cc
+++ b/chrome/browser/sync/sync_setup_flow.cc
@@ -14,6 +14,9 @@
#include "base/values.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_list.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/login/user_manager.h"
+#endif
#if defined(OS_MACOSX)
#include "chrome/browser/cocoa/html_dialog_window_controller_cppsafe.h"
#endif
@@ -393,6 +396,13 @@ void SyncSetupFlow::GetArgsForGaiaLogin(const ProfileSyncService* service,
args->SetBoolean("editable_user", true);
} else {
string16 user(service->GetAuthenticatedUsername());
+#if defined(OS_CHROMEOS)
+ if (user.empty()) {
+ std::string email =
+ chromeos::UserManager::Get()->logged_in_user().email();
+ user = UTF8ToUTF16(email);
+ }
+#endif
args->SetString("user", user);
args->SetInteger("error", 0);
args->SetBoolean("editable_user", user.empty());