OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/chromeos/chromeos_version.h" | 10 #include "base/chromeos/chromeos_version.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 scoped_ptr<LoginUtils> ptr_; | 275 scoped_ptr<LoginUtils> ptr_; |
276 | 276 |
277 DISALLOW_COPY_AND_ASSIGN(LoginUtilsWrapper); | 277 DISALLOW_COPY_AND_ASSIGN(LoginUtilsWrapper); |
278 }; | 278 }; |
279 | 279 |
280 void LoginUtilsImpl::DoBrowserLaunch(Profile* profile, | 280 void LoginUtilsImpl::DoBrowserLaunch(Profile* profile, |
281 LoginDisplayHost* login_host) { | 281 LoginDisplayHost* login_host) { |
282 if (browser_shutdown::IsTryingToQuit()) | 282 if (browser_shutdown::IsTryingToQuit()) |
283 return; | 283 return; |
284 | 284 |
| 285 if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) { |
| 286 UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile); |
| 287 return; |
| 288 } |
| 289 |
285 CommandLine user_flags(CommandLine::NO_PROGRAM); | 290 CommandLine user_flags(CommandLine::NO_PROGRAM); |
286 about_flags::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); | 291 about_flags::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); |
287 about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags); | 292 about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags); |
288 if (!about_flags::AreSwitchesIdenticalToCurrentCommandLine( | 293 if (!about_flags::AreSwitchesIdenticalToCurrentCommandLine( |
289 user_flags, *CommandLine::ForCurrentProcess())) { | 294 user_flags, *CommandLine::ForCurrentProcess())) { |
290 CommandLine::StringVector flags; | 295 CommandLine::StringVector flags; |
291 // argv[0] is the program name |CommandLine::NO_PROGRAM|. | 296 // argv[0] is the program name |CommandLine::NO_PROGRAM|. |
292 flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); | 297 flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); |
293 VLOG(1) << "Restarting to apply per-session flags..."; | 298 VLOG(1) << "Restarting to apply per-session flags..."; |
294 DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( | 299 DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( |
295 UserManager::Get()->GetActiveUser()->email(), flags); | 300 UserManager::Get()->GetActiveUser()->email(), flags); |
296 chrome::ExitCleanly(); | 301 chrome::ExitCleanly(); |
297 return; | 302 return; |
298 } | 303 } |
299 | 304 |
300 if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) { | |
301 UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile); | |
302 return; | |
303 } | |
304 | |
305 if (login_host) { | 305 if (login_host) { |
306 login_host->SetStatusAreaVisible(true); | 306 login_host->SetStatusAreaVisible(true); |
307 login_host->BeforeSessionStart(); | 307 login_host->BeforeSessionStart(); |
308 } | 308 } |
309 | 309 |
310 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); | 310 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); |
311 | 311 |
312 VLOG(1) << "Launching browser..."; | 312 VLOG(1) << "Launching browser..."; |
313 StartupBrowserCreator browser_creator; | 313 StartupBrowserCreator browser_creator; |
314 int return_code; | 314 int return_code; |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 bool LoginUtils::IsWhitelisted(const std::string& username) { | 932 bool LoginUtils::IsWhitelisted(const std::string& username) { |
933 CrosSettings* cros_settings = CrosSettings::Get(); | 933 CrosSettings* cros_settings = CrosSettings::Get(); |
934 bool allow_new_user = false; | 934 bool allow_new_user = false; |
935 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 935 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
936 if (allow_new_user) | 936 if (allow_new_user) |
937 return true; | 937 return true; |
938 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 938 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
939 } | 939 } |
940 | 940 |
941 } // namespace chromeos | 941 } // namespace chromeos |
OLD | NEW |