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

Unified Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 9348022: [cros] Use mocked URLFetcher and other mocks in ExistingUserController tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/login_utils.h ('k') | chrome/browser/chromeos/login/mock_authenticator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/login_utils.cc
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index 41bc4e7ed0d6a5959e85c5ac9bedf95a85b04918..5951ddb3afafdba787730f5ddfbae462ade822e8 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -554,6 +554,8 @@ class LoginUtilsImpl : public LoginUtils,
}
// LoginUtils implementation:
+ virtual void DoBrowserLaunch(Profile* profile,
+ LoginDisplayHost* login_host) OVERRIDE;
virtual void PrepareProfile(
const std::string& username,
const std::string& display_email,
@@ -697,6 +699,45 @@ class LoginUtilsWrapper {
DISALLOW_COPY_AND_ASSIGN(LoginUtilsWrapper);
};
+void LoginUtilsImpl::DoBrowserLaunch(Profile* profile,
+ LoginDisplayHost* login_host) {
+ if (browser_shutdown::IsTryingToQuit())
+ return;
+
+ StatusAreaViewChromeos::SetScreenMode(StatusAreaViewChromeos::BROWSER_MODE);
+ if (login_host) {
+ // Enable status area now as the login window may be destructed anytime
+ // after LaunchBrowser.
+ login_host->SetStatusAreaVisible(true);
+ login_host->SetStatusAreaEnabled(true);
+ }
+
+ BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false);
+
+ VLOG(1) << "Launching browser...";
+ BrowserInit browser_init;
+ int return_code;
+ BrowserInit::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
+ BrowserInit::IS_FIRST_RUN: BrowserInit::IS_NOT_FIRST_RUN;
+ browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(),
+ profile,
+ FilePath(),
+ BrowserInit::IS_PROCESS_STARTUP,
+ first_run,
+ &return_code);
+
+ // Mark login host for deletion after browser starts. This
+ // guarantees that the message loop will be referenced by the
+ // browser before it is dereferenced by the login host.
+ if (login_host) {
+ login_host->OnSessionStart();
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_SESSION_STARTED,
+ content::NotificationService::AllSources(),
+ content::NotificationService::NoDetails());
+ }
+}
+
void LoginUtilsImpl::PrepareProfile(
const std::string& username,
const std::string& display_email,
@@ -1360,46 +1401,6 @@ void LoginUtils::Set(LoginUtils* mock) {
}
// static
-void LoginUtils::DoBrowserLaunch(Profile* profile,
- LoginDisplayHost* login_host) {
- if (browser_shutdown::IsTryingToQuit())
- return;
-
- StatusAreaViewChromeos::SetScreenMode(StatusAreaViewChromeos::BROWSER_MODE);
- if (login_host) {
- // Enable status area now as the login window may be destructed anytime
- // after LaunchBrowser.
- login_host->SetStatusAreaVisible(true);
- login_host->SetStatusAreaEnabled(true);
- }
-
- BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false);
-
- VLOG(1) << "Launching browser...";
- BrowserInit browser_init;
- int return_code;
- BrowserInit::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
- BrowserInit::IS_FIRST_RUN: BrowserInit::IS_NOT_FIRST_RUN;
- browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(),
- profile,
- FilePath(),
- BrowserInit::IS_PROCESS_STARTUP,
- first_run,
- &return_code);
-
- // Mark login host for deletion after browser starts. This
- // guarantees that the message loop will be referenced by the
- // browser before it is dereferenced by the login host.
- if (login_host) {
- login_host->OnSessionStart();
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_SESSION_STARTED,
- content::NotificationService::AllSources(),
- content::NotificationService::NoDetails());
- }
-}
-
-// static
bool LoginUtils::IsWhitelisted(const std::string& username) {
CrosSettings* cros_settings = CrosSettings::Get();
bool allow_new_user = false;
« no previous file with comments | « chrome/browser/chromeos/login/login_utils.h ('k') | chrome/browser/chromeos/login/mock_authenticator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698