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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
276 login_host->BeforeSessionStart(); | 277 login_host->BeforeSessionStart(); |
277 } | 278 } |
278 | 279 |
279 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); | 280 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); |
280 | 281 |
281 VLOG(1) << "Launching browser..."; | 282 VLOG(1) << "Launching browser..."; |
282 StartupBrowserCreator browser_creator; | 283 StartupBrowserCreator browser_creator; |
283 int return_code; | 284 int return_code; |
284 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? | 285 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? |
285 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; | 286 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; |
287 | |
Mattias Nissler (ping if slow)
2013/02/26 16:27:35
Add a TODO here that indicates we want to re-launc
pastarmovj
2013/02/26 17:23:47
Done.
| |
288 about_flags::ConvertFlagsToSwitches(profile->GetPrefs(), | |
289 CommandLine::ForCurrentProcess()); | |
290 | |
286 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), | 291 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), |
287 profile, | 292 profile, |
288 base::FilePath(), | 293 base::FilePath(), |
289 chrome::startup::IS_PROCESS_STARTUP, | 294 chrome::startup::IS_PROCESS_STARTUP, |
290 first_run, | 295 first_run, |
291 &return_code); | 296 &return_code); |
292 | 297 |
293 // Mark login host for deletion after browser starts. This | 298 // Mark login host for deletion after browser starts. This |
294 // guarantees that the message loop will be referenced by the | 299 // guarantees that the message loop will be referenced by the |
295 // browser before it is dereferenced by the login host. | 300 // browser before it is dereferenced by the login host. |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
882 bool LoginUtils::IsWhitelisted(const std::string& username) { | 887 bool LoginUtils::IsWhitelisted(const std::string& username) { |
883 CrosSettings* cros_settings = CrosSettings::Get(); | 888 CrosSettings* cros_settings = CrosSettings::Get(); |
884 bool allow_new_user = false; | 889 bool allow_new_user = false; |
885 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 890 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
886 if (allow_new_user) | 891 if (allow_new_user) |
887 return true; | 892 return true; |
888 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 893 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
889 } | 894 } |
890 | 895 |
891 } // namespace chromeos | 896 } // namespace chromeos |
OLD | NEW |