diff options
author | altimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-19 11:37:21 +0000 |
---|---|---|
committer | altimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-19 11:37:21 +0000 |
commit | 844a10004ee756dd8c4fa9c0c5e6ccadabd83b74 (patch) | |
tree | c25f0168789bca79d68982a3a0b9cd0d39286c81 /chrome/browser/browser_main.cc | |
parent | 9b464b9ca9cebbad516d537a742c2ea9c351a860 (diff) | |
download | chromium_src-844a10004ee756dd8c4fa9c0c5e6ccadabd83b74.zip chromium_src-844a10004ee756dd8c4fa9c0c5e6ccadabd83b74.tar.gz chromium_src-844a10004ee756dd8c4fa9c0c5e6ccadabd83b74.tar.bz2 |
This CL implements alternative asynchronous methods for profile and preferences loading.
BUG=chromium-os:11104
TEST=UserProfileGotten (see "/tmp/login-times-sent") time doesn't increase, while UI jankness decreases.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=81394 (patch set <= 25), but reverted.
Review URL: http://codereview.chromium.org/6716025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r-- | chrome/browser/browser_main.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 1853af7..bd28dd3d 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -977,7 +977,8 @@ void InitializeToolkit(const MainFunctionParams& parameters) { // Class is used to login using passed username and password. // The instance will be deleted upon success or failure. -class StubLogin : public chromeos::LoginStatusConsumer { +class StubLogin : public chromeos::LoginStatusConsumer, + public chromeos::LoginUtils::Delegate { public: explicit StubLogin(std::string username, std::string password) { authenticator_ = chromeos::LoginUtils::Get()->CreateAuthenticator(this); @@ -998,10 +999,17 @@ class StubLogin : public chromeos::LoginStatusConsumer { const std::string& password, const GaiaAuthConsumer::ClientLoginResult& credentials, bool pending_requests) { - chromeos::LoginUtils::Get()->CompleteLogin(username, - password, - credentials, - pending_requests); + // Will call OnProfilePrepared in the end. + chromeos::LoginUtils::Get()->PrepareProfile(username, + password, + credentials, + pending_requests, + this); + } + + // LoginUtils::Delegate implementation: + virtual void OnProfilePrepared(Profile* profile) { + chromeos::LoginUtils::DoBrowserLaunch(profile); delete this; } |