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" | |
11 #include "base/command_line.h" | 10 #include "base/command_line.h" |
12 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
13 #include "base/file_util.h" | 12 #include "base/file_util.h" |
14 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
15 #include "base/location.h" | 14 #include "base/location.h" |
16 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/singleton.h" | 17 #include "base/memory/singleton.h" |
19 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
20 #include "base/path_service.h" | 19 #include "base/path_service.h" |
21 #include "base/prefs/pref_member.h" | 20 #include "base/prefs/pref_member.h" |
22 #include "base/prefs/pref_registry_simple.h" | 21 #include "base/prefs/pref_registry_simple.h" |
23 #include "base/prefs/pref_service.h" | 22 #include "base/prefs/pref_service.h" |
24 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
25 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
26 #include "base/synchronization/lock.h" | 25 #include "base/synchronization/lock.h" |
| 26 #include "base/sys_info.h" |
27 #include "base/task_runner_util.h" | 27 #include "base/task_runner_util.h" |
28 #include "base/threading/worker_pool.h" | 28 #include "base/threading/worker_pool.h" |
29 #include "base/time/time.h" | 29 #include "base/time/time.h" |
30 #include "chrome/browser/about_flags.h" | 30 #include "chrome/browser/about_flags.h" |
31 #include "chrome/browser/app_mode/app_mode_utils.h" | 31 #include "chrome/browser/app_mode/app_mode_utils.h" |
32 #include "chrome/browser/browser_process.h" | 32 #include "chrome/browser/browser_process.h" |
33 #include "chrome/browser/browser_shutdown.h" | 33 #include "chrome/browser/browser_shutdown.h" |
34 #include "chrome/browser/chrome_notification_types.h" | 34 #include "chrome/browser/chrome_notification_types.h" |
35 #include "chrome/browser/chromeos/boot_times_loader.h" | 35 #include "chrome/browser/chromeos/boot_times_loader.h" |
36 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 36 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 } | 316 } |
317 | 317 |
318 btl->AddLoginTimeMarker("UserLoggedIn-Start", false); | 318 btl->AddLoginTimeMarker("UserLoggedIn-Start", false); |
319 UserManager* user_manager = UserManager::Get(); | 319 UserManager* user_manager = UserManager::Get(); |
320 user_manager->UserLoggedIn(user_context.username, | 320 user_manager->UserLoggedIn(user_context.username, |
321 user_context.username_hash, | 321 user_context.username_hash, |
322 false); | 322 false); |
323 btl->AddLoginTimeMarker("UserLoggedIn-End", false); | 323 btl->AddLoginTimeMarker("UserLoggedIn-End", false); |
324 | 324 |
325 // Switch log file as soon as possible. | 325 // Switch log file as soon as possible. |
326 if (base::chromeos::IsRunningOnChromeOS()) | 326 if (base::SysInfo::IsRunningOnChromeOS()) |
327 logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); | 327 logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); |
328 | 328 |
329 // Update user's displayed email. | 329 // Update user's displayed email. |
330 if (!display_email.empty()) | 330 if (!display_email.empty()) |
331 user_manager->SaveUserDisplayEmail(user_context.username, display_email); | 331 user_manager->SaveUserDisplayEmail(user_context.username, display_email); |
332 | 332 |
333 user_context_ = user_context; | 333 user_context_ = user_context; |
334 | 334 |
335 using_oauth_ = using_oauth; | 335 using_oauth_ = using_oauth; |
336 has_web_auth_cookies_ = has_cookies; | 336 has_web_auth_cookies_ = has_cookies; |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 bool LoginUtils::IsWhitelisted(const std::string& username) { | 807 bool LoginUtils::IsWhitelisted(const std::string& username) { |
808 CrosSettings* cros_settings = CrosSettings::Get(); | 808 CrosSettings* cros_settings = CrosSettings::Get(); |
809 bool allow_new_user = false; | 809 bool allow_new_user = false; |
810 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 810 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
811 if (allow_new_user) | 811 if (allow_new_user) |
812 return true; | 812 return true; |
813 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 813 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
814 } | 814 } |
815 | 815 |
816 } // namespace chromeos | 816 } // namespace chromeos |
OLD | NEW |