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

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: Merge fix Created 7 years, 2 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/language_switch_menu.h" 31 #include "chrome/browser/chromeos/login/language_switch_menu.h"
32 #include "chrome/browser/chromeos/login/login_display.h" 32 #include "chrome/browser/chromeos/login/login_display.h"
33 #include "chrome/browser/chromeos/login/login_utils.h" 33 #include "chrome/browser/chromeos/login/login_utils.h"
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 return session_started_; 1038 return session_started_;
1039 } 1039 }
1040 1040
1041 bool UserManagerImpl::UserSessionsRestored() const { 1041 bool UserManagerImpl::UserSessionsRestored() const {
1042 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1042 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1043 return user_sessions_restored_; 1043 return user_sessions_restored_;
1044 } 1044 }
1045 1045
1046 bool UserManagerImpl::HasBrowserRestarted() const { 1046 bool UserManagerImpl::HasBrowserRestarted() const {
1047 CommandLine* command_line = CommandLine::ForCurrentProcess(); 1047 CommandLine* command_line = CommandLine::ForCurrentProcess();
1048 return base::chromeos::IsRunningOnChromeOS() && 1048 return base::SysInfo::IsRunningOnChromeOS() &&
1049 command_line->HasSwitch(switches::kLoginUser) && 1049 command_line->HasSwitch(switches::kLoginUser) &&
1050 !command_line->HasSwitch(switches::kLoginPassword); 1050 !command_line->HasSwitch(switches::kLoginPassword);
1051 } 1051 }
1052 1052
1053 bool UserManagerImpl::IsUserNonCryptohomeDataEphemeral( 1053 bool UserManagerImpl::IsUserNonCryptohomeDataEphemeral(
1054 const std::string& email) const { 1054 const std::string& email) const {
1055 // Data belonging to the guest, retail mode and stub users is always 1055 // Data belonging to the guest, retail mode and stub users is always
1056 // ephemeral. 1056 // ephemeral.
1057 if (email == UserManager::kGuestUserName || 1057 if (email == UserManager::kGuestUserName ||
1058 email == UserManager::kRetailModeUserName || 1058 email == UserManager::kRetailModeUserName ||
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
1975 } 1975 }
1976 } 1976 }
1977 1977
1978 void UserManagerImpl::OnUserNotAllowed() { 1978 void UserManagerImpl::OnUserNotAllowed() {
1979 LOG(ERROR) << "Shutdown session because a user is not allowed to be in the " 1979 LOG(ERROR) << "Shutdown session because a user is not allowed to be in the "
1980 "current session"; 1980 "current session";
1981 chrome::AttemptUserExit(); 1981 chrome::AttemptUserExit();
1982 } 1982 }
1983 1983
1984 } // namespace chromeos 1984 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/startup_utils.cc ('k') | chrome/browser/chromeos/login/version_info_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698