Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 23904025: Move IsRunningOnChromeOS to SysInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/user_manager_impl.h" 5 #include "chrome/browser/chromeos/login/user_manager_impl.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/chromeos/chromeos_version.h"
13 #include "base/command_line.h" 12 #include "base/command_line.h"
14 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
15 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
16 #include "base/logging.h" 15 #include "base/logging.h"
17 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
18 #include "base/prefs/pref_registry_simple.h" 17 #include "base/prefs/pref_registry_simple.h"
19 #include "base/prefs/pref_service.h" 18 #include "base/prefs/pref_service.h"
20 #include "base/rand_util.h" 19 #include "base/rand_util.h"
21 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
22 #include "base/strings/stringprintf.h" 21 #include "base/strings/stringprintf.h"
23 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
23 #include "base/sys_info.h"
24 #include "base/values.h" 24 #include "base/values.h"
25 #include "chrome/browser/app_mode/app_mode_utils.h" 25 #include "chrome/browser/app_mode/app_mode_utils.h"
26 #include "chrome/browser/browser_process.h" 26 #include "chrome/browser/browser_process.h"
27 #include "chrome/browser/chrome_notification_types.h" 27 #include "chrome/browser/chrome_notification_types.h"
28 #include "chrome/browser/chromeos/login/auth_sync_observer.h" 28 #include "chrome/browser/chromeos/login/auth_sync_observer.h"
29 #include "chrome/browser/chromeos/login/auth_sync_observer_factory.h" 29 #include "chrome/browser/chromeos/login/auth_sync_observer_factory.h"
30 #include "chrome/browser/chromeos/login/default_pinned_apps_field_trial.h" 30 #include "chrome/browser/chromeos/login/default_pinned_apps_field_trial.h"
31 #include "chrome/browser/chromeos/login/login_display.h" 31 #include "chrome/browser/chromeos/login/login_display.h"
32 #include "chrome/browser/chromeos/login/login_utils.h" 32 #include "chrome/browser/chromeos/login/login_utils.h"
33 #include "chrome/browser/chromeos/login/remove_user_delegate.h" 33 #include "chrome/browser/chromeos/login/remove_user_delegate.h"
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 return session_started_; 895 return session_started_;
896 } 896 }
897 897
898 bool UserManagerImpl::UserSessionsRestored() const { 898 bool UserManagerImpl::UserSessionsRestored() const {
899 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 899 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
900 return user_sessions_restored_; 900 return user_sessions_restored_;
901 } 901 }
902 902
903 bool UserManagerImpl::HasBrowserRestarted() const { 903 bool UserManagerImpl::HasBrowserRestarted() const {
904 CommandLine* command_line = CommandLine::ForCurrentProcess(); 904 CommandLine* command_line = CommandLine::ForCurrentProcess();
905 return base::chromeos::IsRunningOnChromeOS() && 905 return base::SysInfo::IsRunningOnChromeOS() &&
906 command_line->HasSwitch(switches::kLoginUser) && 906 command_line->HasSwitch(switches::kLoginUser) &&
907 !command_line->HasSwitch(switches::kLoginPassword); 907 !command_line->HasSwitch(switches::kLoginPassword);
908 } 908 }
909 909
910 bool UserManagerImpl::IsUserNonCryptohomeDataEphemeral( 910 bool UserManagerImpl::IsUserNonCryptohomeDataEphemeral(
911 const std::string& email) const { 911 const std::string& email) const {
912 // Data belonging to the guest, retail mode and stub users is always 912 // Data belonging to the guest, retail mode and stub users is always
913 // ephemeral. 913 // ephemeral.
914 if (email == UserManager::kGuestUserName || 914 if (email == UserManager::kGuestUserName ||
915 email == UserManager::kRetailModeUserName || 915 email == UserManager::kRetailModeUserName ||
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 base::TimeTicks::Now() - manager_creation_time_; 1824 base::TimeTicks::Now() - manager_creation_time_;
1825 if (!last_email.empty() && email != last_email && 1825 if (!last_email.empty() && email != last_email &&
1826 time_to_login.InSeconds() <= kLogoutToLoginDelayMaxSec) { 1826 time_to_login.InSeconds() <= kLogoutToLoginDelayMaxSec) {
1827 UMA_HISTOGRAM_CUSTOM_COUNTS("UserManager.LogoutToLoginDelay", 1827 UMA_HISTOGRAM_CUSTOM_COUNTS("UserManager.LogoutToLoginDelay",
1828 time_to_login.InSeconds(), 0, kLogoutToLoginDelayMaxSec, 50); 1828 time_to_login.InSeconds(), 0, kLogoutToLoginDelayMaxSec, 50);
1829 } 1829 }
1830 } 1830 }
1831 } 1831 }
1832 1832
1833 } // namespace chromeos 1833 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698