| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/login/fake_login_utils.h" | 5 #include "chrome/browser/chromeos/login/fake_login_utils.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 if (!ChromeUserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) { | 39 if (!ChromeUserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) { |
| 40 ChromeUserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile); | 40 ChromeUserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile); |
| 41 return; | 41 return; |
| 42 } | 42 } |
| 43 login_host->BeforeSessionStart(); | 43 login_host->BeforeSessionStart(); |
| 44 if (should_launch_browser_) { | 44 if (should_launch_browser_) { |
| 45 StartupBrowserCreator browser_creator; | 45 StartupBrowserCreator browser_creator; |
| 46 chrome::startup::IsFirstRun first_run = | 46 chrome::startup::IsFirstRun first_run = |
| 47 first_run::IsChromeFirstRun() ? chrome::startup::IS_FIRST_RUN | 47 first_run::IsChromeFirstRun() ? chrome::startup::IS_FIRST_RUN |
| 48 : chrome::startup::IS_NOT_FIRST_RUN; | 48 : chrome::startup::IS_NOT_FIRST_RUN; |
| 49 ASSERT_TRUE( | 49 ASSERT_TRUE(browser_creator.LaunchBrowser( |
| 50 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), | 50 *base::CommandLine::ForCurrentProcess(), profile, base::FilePath(), |
| 51 profile, | 51 chrome::startup::IS_PROCESS_STARTUP, first_run, NULL)); |
| 52 base::FilePath(), | |
| 53 chrome::startup::IS_PROCESS_STARTUP, | |
| 54 first_run, | |
| 55 NULL)); | |
| 56 } | 52 } |
| 57 if (login_host) | 53 if (login_host) |
| 58 login_host->Finalize(); | 54 login_host->Finalize(); |
| 59 user_manager::UserManager::Get()->SessionStarted(); | 55 user_manager::UserManager::Get()->SessionStarted(); |
| 60 } | 56 } |
| 61 | 57 |
| 62 void FakeLoginUtils::PrepareProfile(const UserContext& user_context, | 58 void FakeLoginUtils::PrepareProfile(const UserContext& user_context, |
| 63 bool has_cookies, | 59 bool has_cookies, |
| 64 bool has_active_session, | 60 bool has_active_session, |
| 65 LoginUtils::Delegate* delegate) { | 61 LoginUtils::Delegate* delegate) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 117 |
| 122 void FakeLoginUtils::SetExpectedCredentials(const UserContext& user_context) { | 118 void FakeLoginUtils::SetExpectedCredentials(const UserContext& user_context) { |
| 123 expected_user_context_ = user_context; | 119 expected_user_context_ = user_context; |
| 124 if (authenticator_.get()) { | 120 if (authenticator_.get()) { |
| 125 static_cast<MockAuthenticator*>(authenticator_.get())-> | 121 static_cast<MockAuthenticator*>(authenticator_.get())-> |
| 126 SetExpectedCredentials(user_context); | 122 SetExpectedCredentials(user_context); |
| 127 } | 123 } |
| 128 } | 124 } |
| 129 | 125 |
| 130 } // namespace chromeos | 126 } // namespace chromeos |
| OLD | NEW |