| 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" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/location.h" | 15 #include "base/location.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/memory/singleton.h" | 18 #include "base/memory/singleton.h" |
| 19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 20 #include "base/prefs/pref_registry_simple.h" | 20 #include "base/prefs/pref_registry_simple.h" |
| 21 #include "base/prefs/pref_service.h" | 21 #include "base/prefs/pref_service.h" |
| 22 #include "base/prefs/public/pref_member.h" | 22 #include "base/prefs/public/pref_member.h" |
| 23 #include "base/string_util.h" | 23 #include "base/string_util.h" |
| 24 #include "base/synchronization/lock.h" | 24 #include "base/synchronization/lock.h" |
| 25 #include "base/task_runner_util.h" | 25 #include "base/task_runner_util.h" |
| 26 #include "base/threading/worker_pool.h" | 26 #include "base/threading/worker_pool.h" |
| 27 #include "base/time.h" | 27 #include "base/time.h" |
| 28 #include "base/utf_string_conversions.h" | 28 #include "base/utf_string_conversions.h" |
| 29 #include "chrome/browser/about_flags.h" |
| 29 #include "chrome/browser/browser_process.h" | 30 #include "chrome/browser/browser_process.h" |
| 30 #include "chrome/browser/browser_shutdown.h" | 31 #include "chrome/browser/browser_shutdown.h" |
| 31 #include "chrome/browser/chromeos/boot_times_loader.h" | 32 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 32 #include "chrome/browser/chromeos/cros/cros_library.h" | 33 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 33 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 34 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
| 34 #include "chrome/browser/chromeos/cros/network_library.h" | 35 #include "chrome/browser/chromeos/cros/network_library.h" |
| 35 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 36 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
| 36 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 37 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 37 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 38 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 38 #include "chrome/browser/chromeos/login/chrome_restart_request.h" | 39 #include "chrome/browser/chromeos/login/chrome_restart_request.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 login_host->BeforeSessionStart(); | 278 login_host->BeforeSessionStart(); |
| 278 } | 279 } |
| 279 | 280 |
| 280 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); | 281 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); |
| 281 | 282 |
| 282 VLOG(1) << "Launching browser..."; | 283 VLOG(1) << "Launching browser..."; |
| 283 StartupBrowserCreator browser_creator; | 284 StartupBrowserCreator browser_creator; |
| 284 int return_code; | 285 int return_code; |
| 285 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? | 286 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? |
| 286 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; | 287 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; |
| 288 |
| 289 // TODO(pastarmovj): Restart the browser and apply any flags set by the user. |
| 290 // See: http://crosbug.com/39249 |
| 291 |
| 287 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), | 292 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), |
| 288 profile, | 293 profile, |
| 289 base::FilePath(), | 294 base::FilePath(), |
| 290 chrome::startup::IS_PROCESS_STARTUP, | 295 chrome::startup::IS_PROCESS_STARTUP, |
| 291 first_run, | 296 first_run, |
| 292 &return_code); | 297 &return_code); |
| 293 | 298 |
| 294 // Mark login host for deletion after browser starts. This | 299 // Mark login host for deletion after browser starts. This |
| 295 // guarantees that the message loop will be referenced by the | 300 // guarantees that the message loop will be referenced by the |
| 296 // browser before it is dereferenced by the login host. | 301 // browser before it is dereferenced by the login host. |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 bool LoginUtils::IsWhitelisted(const std::string& username) { | 890 bool LoginUtils::IsWhitelisted(const std::string& username) { |
| 886 CrosSettings* cros_settings = CrosSettings::Get(); | 891 CrosSettings* cros_settings = CrosSettings::Get(); |
| 887 bool allow_new_user = false; | 892 bool allow_new_user = false; |
| 888 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 893 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 889 if (allow_new_user) | 894 if (allow_new_user) |
| 890 return true; | 895 return true; |
| 891 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 896 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
| 892 } | 897 } |
| 893 | 898 |
| 894 } // namespace chromeos | 899 } // namespace chromeos |
| OLD | NEW |