| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 } | 323 } |
| 324 | 324 |
| 325 btl->AddLoginTimeMarker("UserLoggedIn-Start", false); | 325 btl->AddLoginTimeMarker("UserLoggedIn-Start", false); |
| 326 UserManager* user_manager = UserManager::Get(); | 326 UserManager* user_manager = UserManager::Get(); |
| 327 user_manager->UserLoggedIn(user_context.username, | 327 user_manager->UserLoggedIn(user_context.username, |
| 328 user_context.username_hash, | 328 user_context.username_hash, |
| 329 false); | 329 false); |
| 330 btl->AddLoginTimeMarker("UserLoggedIn-End", false); | 330 btl->AddLoginTimeMarker("UserLoggedIn-End", false); |
| 331 | 331 |
| 332 // Switch log file as soon as possible. | 332 // Switch log file as soon as possible. |
| 333 if (base::chromeos::IsRunningOnChromeOS()) | 333 if (base::SysInfo::IsRunningOnChromeOS()) |
| 334 logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); | 334 logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); |
| 335 | 335 |
| 336 // Update user's displayed email. | 336 // Update user's displayed email. |
| 337 if (!display_email.empty()) | 337 if (!display_email.empty()) |
| 338 user_manager->SaveUserDisplayEmail(user_context.username, display_email); | 338 user_manager->SaveUserDisplayEmail(user_context.username, display_email); |
| 339 | 339 |
| 340 user_context_ = user_context; | 340 user_context_ = user_context; |
| 341 | 341 |
| 342 using_oauth_ = using_oauth; | 342 using_oauth_ = using_oauth; |
| 343 has_web_auth_cookies_ = has_cookies; | 343 has_web_auth_cookies_ = has_cookies; |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 bool LoginUtils::IsWhitelisted(const std::string& username) { | 833 bool LoginUtils::IsWhitelisted(const std::string& username) { |
| 834 CrosSettings* cros_settings = CrosSettings::Get(); | 834 CrosSettings* cros_settings = CrosSettings::Get(); |
| 835 bool allow_new_user = false; | 835 bool allow_new_user = false; |
| 836 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 836 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 837 if (allow_new_user) | 837 if (allow_new_user) |
| 838 return true; | 838 return true; |
| 839 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 839 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
| 840 } | 840 } |
| 841 | 841 |
| 842 } // namespace chromeos | 842 } // namespace chromeos |
| OLD | NEW |