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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 } | 1333 } |
1334 | 1334 |
1335 // static | 1335 // static |
1336 void LoginUtils::DoBrowserLaunch(Profile* profile, | 1336 void LoginUtils::DoBrowserLaunch(Profile* profile, |
1337 LoginDisplayHost* login_host) { | 1337 LoginDisplayHost* login_host) { |
1338 if (browser_shutdown::IsTryingToQuit()) | 1338 if (browser_shutdown::IsTryingToQuit()) |
1339 return; | 1339 return; |
1340 | 1340 |
1341 StatusAreaViewChromeos::SetScreenMode(StatusAreaViewChromeos::BROWSER_MODE); | 1341 StatusAreaViewChromeos::SetScreenMode(StatusAreaViewChromeos::BROWSER_MODE); |
1342 if (login_host) { | 1342 if (login_host) { |
| 1343 // Enable status area now as the login window may be destructed anytime |
| 1344 // after LaunchBrowser. |
1343 login_host->SetStatusAreaVisible(true); | 1345 login_host->SetStatusAreaVisible(true); |
1344 login_host->SetStatusAreaEnabled(true); | 1346 login_host->SetStatusAreaEnabled(true); |
1345 #if defined(USE_AURA) | |
1346 // Close lock window now so that the launched browser can receive focus. | |
1347 // TODO(oshima): Implement hide animation for lock screens. | |
1348 login_host->CloseWindow(); | |
1349 #endif | |
1350 } | 1347 } |
1351 | 1348 |
1352 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); | 1349 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); |
1353 | 1350 |
1354 VLOG(1) << "Launching browser..."; | 1351 VLOG(1) << "Launching browser..."; |
1355 BrowserInit browser_init; | 1352 BrowserInit browser_init; |
1356 int return_code; | 1353 int return_code; |
1357 BrowserInit::IsFirstRun first_run = first_run::IsChromeFirstRun() ? | 1354 BrowserInit::IsFirstRun first_run = first_run::IsChromeFirstRun() ? |
1358 BrowserInit::IS_FIRST_RUN: BrowserInit::IS_NOT_FIRST_RUN; | 1355 BrowserInit::IS_FIRST_RUN: BrowserInit::IS_NOT_FIRST_RUN; |
1359 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), | 1356 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), |
(...skipping 19 matching lines...) Expand all Loading... |
1379 bool LoginUtils::IsWhitelisted(const std::string& username) { | 1376 bool LoginUtils::IsWhitelisted(const std::string& username) { |
1380 CrosSettings* cros_settings = CrosSettings::Get(); | 1377 CrosSettings* cros_settings = CrosSettings::Get(); |
1381 bool allow_new_user = false; | 1378 bool allow_new_user = false; |
1382 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 1379 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
1383 if (allow_new_user) | 1380 if (allow_new_user) |
1384 return true; | 1381 return true; |
1385 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 1382 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
1386 } | 1383 } |
1387 | 1384 |
1388 } // namespace chromeos | 1385 } // namespace chromeos |
OLD | NEW |