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

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 290483003: Tame the proliferation of UserContext constructors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 7 months 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/screenlock_private_apitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromeos/chrome_browser_main_chromeos.h" 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // Login ----------------------------------------------------------------------- 133 // Login -----------------------------------------------------------------------
134 134
135 // Class is used to login using passed username and password. 135 // Class is used to login using passed username and password.
136 // The instance will be deleted upon success or failure. 136 // The instance will be deleted upon success or failure.
137 class StubLogin : public LoginStatusConsumer, 137 class StubLogin : public LoginStatusConsumer,
138 public LoginUtils::Delegate { 138 public LoginUtils::Delegate {
139 public: 139 public:
140 StubLogin(std::string username, std::string password) 140 StubLogin(std::string username, std::string password)
141 : profile_prepared_(false) { 141 : profile_prepared_(false) {
142 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); 142 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this);
143 authenticator_.get()->AuthenticateToLogin( 143 UserContext user_context(username);
144 ProfileHelper::GetSigninProfile(), 144 user_context.SetPassword(password);
145 UserContext(username, password, std::string() /* auth_code */)); 145 authenticator_.get()->AuthenticateToLogin(ProfileHelper::GetSigninProfile(),
146 user_context);
146 } 147 }
147 148
148 virtual ~StubLogin() { 149 virtual ~StubLogin() {
149 LoginUtils::Get()->DelegateDeleted(this); 150 LoginUtils::Get()->DelegateDeleted(this);
150 } 151 }
151 152
152 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE { 153 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE {
153 LOG(ERROR) << "Login Failure: " << error.GetErrorString(); 154 LOG(ERROR) << "Login Failure: " << error.GetErrorString();
154 delete this; 155 delete this;
155 } 156 }
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 // Destroy DBus services immediately after threads are stopped. 858 // Destroy DBus services immediately after threads are stopped.
858 dbus_services_.reset(); 859 dbus_services_.reset();
859 860
860 ChromeBrowserMainPartsLinux::PostDestroyThreads(); 861 ChromeBrowserMainPartsLinux::PostDestroyThreads();
861 862
862 // Destroy DeviceSettingsService after g_browser_process. 863 // Destroy DeviceSettingsService after g_browser_process.
863 DeviceSettingsService::Shutdown(); 864 DeviceSettingsService::Shutdown();
864 } 865 }
865 866
866 } // namespace chromeos 867 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/screenlock_private_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698