[cros] user_manager component - move UserManagerBase and UserManager
* Move UserManager test helper classes in their own files * Move RemoveUserDelegate to user_manager component * Move UserManager ownership to BrowserProcessPlatformPart * UserManager::Get() still stays but instance is explicitly initialized/cleared with instance->Initialize()|Destroy() * ScopedUserManagerEnabler / ScopedTestUserManager classes still work * Introduce ChromeUserManager base class (impl: ChromeUserManagerImpl) * ChromeUserManager adds getters for MultiProfileUserController, UserImageManager, SupervisedUserManager. All clients that were using these methods now access ChromeUserManager instance through ChromeUserManager::Get(). * FakeUserManager/MockUserManager implement ChromeUserManager * Move *UserFlow() methods out of UserManager to ChromeUserManager BUG=387614 TBR=thestig,benwells Review URL: https://codereview.chromium.org/444903002 Cr-Commit-Position: refs/heads/master@{#289827} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289827 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
apps
chrome
browser
DEPScomponent_loader.cccrx_installer.cccrx_installer_browsertest.ccextension_action_icon_factory_unittest.ccextension_assets_manager_chromeos.ccextension_garbage_collector_chromeos.ccextension_garbage_collector_chromeos_unittest.ccextension_gcm_app_handler_unittest.ccextension_service_test_base.hextension_service_unittest.ccextension_system_impl.ccextension_ui_unittest.ccextension_web_ui_unittest.ccexternal_provider_impl.ccexternal_provider_impl_chromeos_unittest.ccexternal_provider_impl_unittest.ccpage_action_controller_unittest.cctest_extension_environment.hflags_ui.cc
chrome_browser.gypichrome_browser_chromeos.gypiapps
background
browser_process_platform_part_chromeos.ccbrowser_process_platform_part_chromeos.hbrowsing_data
chrome_browser_field_trials_desktop.ccchrome_content_browser_client.ccchromeos
accessibility
accessibility_manager.ccaccessibility_manager_browsertest.ccmagnification_manager.ccmagnification_manager_browsertest.cc
app_mode
app_session_lifetime.cckiosk_app_manager.cckiosk_mode_idle_app_name_notification.ccstartup_app_launcher.cc
attestation
background
boot_times_loader.ccchrome_browser_main_chromeos.ccdisplay
drive
events
extensions
file_manager
info_private_api.ccwallpaper_api.ccwallpaper_private_api.ccwallpaper_private_api_unittest.ccfile_manager
file_system_provider
first_run
input_method
kiosk_mode
login
app_launch_controller.ccapp_launch_signin_screen.ccapp_launch_signin_screen.hwizard_controller.cc
auth
chrome_restart_request.cccrash_restore_browsertest.ccdemo_mode
existing_user_controller.ccexisting_user_controller_auto_login_unittest.ccexisting_user_controller_browsertest.ccfake_login_utils.cchelper.cckiosk_browsertest.cclock
login_manager_test.cclogin_screen_policy_browsertest.cclogin_utils.ccsaml
screens
session
signin
auth_sync_observer.ccmerge_session_load_page_unittest.ccmerge_session_throttle.ccoauth2_browsertest.ccoauth2_login_manager.cc
supervised
supervised_user_authentication.ccsupervised_user_creation_browsertest.ccsupervised_user_creation_controller_new.ccsupervised_user_creation_screen.ccsupervised_user_login_flow.ccsupervised_user_password_browsertest.ccsupervised_user_test_base.cc
ui
login_display.hlogin_display_host_impl.ccuser_adding_screen.ccuser_adding_screen_browsertest.ccwebui_login_display.cc
user_flow.ccusers
avatar
user_image_manager_browsertest.ccuser_image_manager_impl.ccuser_image_manager_impl.huser_image_sync_observer.ccuser_image_sync_observer.h
chrome_user_manager.ccchrome_user_manager.hchrome_user_manager_impl.ccchrome_user_manager_impl.hfake_user_manager.ccfake_user_manager.hmock_user_manager.ccmock_user_manager.hmulti_profile_user_controller.ccmulti_profile_user_controller_unittest.ccscoped_test_user_manager.ccscoped_test_user_manager.hscoped_user_manager_enabler.ccscoped_user_manager_enabler.hsupervised_user_manager_impl.ccsupervised_user_manager_impl.huser_manager.ccuser_manager_unittest.ccwallpaper
net
ownership
policy
blocking_login_browsertest.ccdevice_local_account.hdevice_local_account_browsertest.ccdevice_status_collector.ccdevice_status_collector_browsertest.ccpolicy_cert_service.ccpolicy_cert_service.hpolicy_cert_service_factory.ccuser_cloud_policy_manager_chromeos.ccuser_cloud_policy_manager_factory_chromeos.ccuser_network_configuration_updater_factory.cc
preferences.ccpreferences.hpreferences_browsertest.ccpreferences_unittest.ccprofiles
avatar_menu_actions_chromeos.ccprofile_helper.ccprofile_helper.hprofile_list_chromeos.ccprofile_list_chromeos_unittest.cc
proxy_config_service_impl.ccsettings
sim_dialog_delegate.ccstatus
system
system_logs
ui
extensions
activity_log
activity_database_unittest.ccactivity_log_enabled_unittest.ccactivity_log_unittest.cccounting_policy_unittest.ccfullstream_ui_policy_unittest.cc
api
autotest_private
braille_display_private
feedback_private
identity
image_writer_private
input
input_ime
networking_private
runtime
updater
zipfile_installer_unittest.ccinvalidation
io_thread.cclifetime
media
media_galleries
gallery_watch_manager_unittest.ccmedia_file_system_registry_unittest.ccmedia_galleries_permission_controller_unittest.ccmedia_galleries_preferences_unittest.ccmedia_galleries_scan_result_controller_unittest.ccmedia_scan_manager_unittest.cc
metrics
net
notifications
message_center_settings_controller.ccmessage_center_settings_controller.hmessage_center_settings_controller_unittest.cc
performance_monitor
policy
cloud
configuration_policy_handler_list_factory.ccprofile_policy_connector.ccschema_registry_service_factory.ccprefs
profiles
off_the_record_profile_impl.ccprofile_impl.ccprofile_io_data.ccprofile_manager.ccprofile_manager_unittest.ccprofiles_state.cc
signin
chrome_signin_client.cceasy_unlock_service.cceasy_unlock_service_browsertest_chromeos.ccsignin_error_notifier_ash.cc
supervised_user
chromeos
manager_password_service.ccmanager_password_service_factory.ccsupervised_user_password_service.ccsupervised_user_password_service_factory.cc
supervised_user_service.ccsync
sync_file_system
drive_backend_v1
themes
ui
ash
app_sync_ui_state.ccchrome_shell_delegate.cc
browser_list.cclauncher
multi_user
screenshot_taker.ccsession_state_delegate_chromeos.ccsession_state_delegate_chromeos.hsession_state_delegate_chromeos_unittest.ccsystem_tray_delegate_chromeos.ccuser_accounts_delegate_chromeos.cclocation_bar
startup
sync
webui
chromeos
first_run
login
error_screen_handler.ccgaia_screen_handler.ccsignin_screen_handler.ccsignin_screen_handler.hsignin_userlist_unittest.ccsupervised_user_creation_screen_handler.ccterms_of_service_screen_handler.cc
ui_account_tweaks.ccextensions
chromeos
help
options
browser_options_handler.cc
policy_ui.ccchromeos
accounts_options_browsertest.ccaccounts_options_handler.ccchange_picture_options_handler.ccconsumer_management_handler.cccore_chromeos_options_handler.cccros_language_options_handler.ccshared_options_browsertest.ccuser_image_source.cc
content_settings_handler.cctest
components
user_manager.gypi
user_manager
extensions/shell/browser
@ -6,6 +6,7 @@ include_rules = [
|
||||
"+content/public/test",
|
||||
"+components/keyed_service",
|
||||
"+components/pref_registry/pref_registry_syncable.h",
|
||||
"+components/user_manager",
|
||||
"+components/web_modal",
|
||||
"+extensions",
|
||||
"+net/base",
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#include "apps/launcher.h"
|
||||
|
||||
#include <utility>
|
||||
#include <set>
|
||||
#include <utility>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/file_util.h"
|
||||
@ -40,7 +40,7 @@
|
||||
#include "url/gurl.h"
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#endif
|
||||
|
||||
namespace app_runtime = extensions::core_api::app_runtime;
|
||||
@ -318,7 +318,7 @@ void LaunchPlatformAppWithCommandLine(Profile* profile,
|
||||
if (extensions::KioskModeInfo::IsKioskOnly(extension)) {
|
||||
bool in_kiosk_mode = false;
|
||||
#if defined(OS_CHROMEOS)
|
||||
chromeos::UserManager* user_manager = chromeos::UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
in_kiosk_mode = user_manager && user_manager->IsLoggedInAsKioskApp();
|
||||
#endif
|
||||
if (!in_kiosk_mode) {
|
||||
|
@ -66,6 +66,7 @@ include_rules = [
|
||||
"+components/translate/core/browser",
|
||||
"+components/translate/core/common",
|
||||
"+components/url_matcher",
|
||||
"+components/user_manager",
|
||||
"+components/user_prefs",
|
||||
"+components/web_modal",
|
||||
"+components/webdata/common",
|
||||
|
@ -50,7 +50,7 @@
|
||||
#if defined(OS_CHROMEOS)
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "chrome/browser/chromeos/login/users/mock_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
||||
#include "chromeos/dbus/dbus_thread_manager.h"
|
||||
#include "chromeos/dbus/fake_dbus_thread_manager.h"
|
||||
#include "chromeos/dbus/fake_power_manager_client.h"
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "ui/message_center/message_center.h"
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
|
||||
#include "chrome/browser/chromeos/settings/cros_settings.h"
|
||||
#include "chrome/browser/chromeos/settings/device_settings_service.h"
|
||||
#endif
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "base/time/tick_clock.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chromeos/login/session/chrome_session_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h"
|
||||
#include "chrome/browser/chromeos/memory/oom_priority_manager.h"
|
||||
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
@ -35,6 +36,18 @@ void BrowserProcessPlatformPart::ShutdownAutomaticRebootManager() {
|
||||
automatic_reboot_manager_.reset();
|
||||
}
|
||||
|
||||
void BrowserProcessPlatformPart::InitializeChromeUserManager() {
|
||||
DCHECK(!chrome_user_manager_);
|
||||
chrome_user_manager_ =
|
||||
chromeos::ChromeUserManagerImpl::CreateChromeUserManager();
|
||||
chrome_user_manager_->Initialize();
|
||||
}
|
||||
|
||||
void BrowserProcessPlatformPart::DestroyChromeUserManager() {
|
||||
chrome_user_manager_->Destroy();
|
||||
chrome_user_manager_.reset();
|
||||
}
|
||||
|
||||
void BrowserProcessPlatformPart::InitializeSessionManager(
|
||||
const base::CommandLine& parsed_command_line,
|
||||
Profile* profile,
|
||||
|
@ -15,6 +15,7 @@ class CommandLine;
|
||||
}
|
||||
|
||||
namespace chromeos {
|
||||
class ChromeUserManager;
|
||||
class OomPriorityManager;
|
||||
class ProfileHelper;
|
||||
}
|
||||
@ -45,6 +46,9 @@ class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase,
|
||||
void InitializeAutomaticRebootManager();
|
||||
void ShutdownAutomaticRebootManager();
|
||||
|
||||
void InitializeChromeUserManager();
|
||||
void DestroyChromeUserManager();
|
||||
|
||||
void InitializeSessionManager(const base::CommandLine& parsed_command_line,
|
||||
Profile* profile,
|
||||
bool is_running_test);
|
||||
@ -69,6 +73,10 @@ class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase,
|
||||
|
||||
policy::BrowserPolicyConnectorChromeOS* browser_policy_connector_chromeos();
|
||||
|
||||
chromeos::ChromeUserManager* user_manager() {
|
||||
return chrome_user_manager_.get();
|
||||
}
|
||||
|
||||
// Overridden from BrowserProcessPlatformPartBase:
|
||||
virtual void StartTearDown() OVERRIDE;
|
||||
|
||||
@ -88,6 +96,8 @@ class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase,
|
||||
scoped_ptr<chromeos::system::AutomaticRebootManager>
|
||||
automatic_reboot_manager_;
|
||||
|
||||
scoped_ptr<chromeos::ChromeUserManager> chrome_user_manager_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(BrowserProcessPlatformPart);
|
||||
};
|
||||
|
||||
|
@ -75,7 +75,6 @@
|
||||
#include "webkit/common/quota/quota_types.h"
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chromeos/attestation/attestation_constants.h"
|
||||
#include "chromeos/dbus/cryptohome_client.h"
|
||||
|
@ -55,7 +55,7 @@
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
#include "chrome/browser/chromeos/login/users/mock_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
||||
#include "chrome/browser/chromeos/settings/cros_settings.h"
|
||||
#include "chrome/browser/chromeos/settings/device_settings_service.h"
|
||||
#include "chromeos/dbus/dbus_thread_manager.h"
|
||||
|
@ -27,10 +27,6 @@
|
||||
#include "net/spdy/spdy_session.h"
|
||||
#include "ui/base/layout.h"
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#endif
|
||||
|
||||
namespace chrome {
|
||||
|
||||
namespace {
|
||||
|
@ -154,9 +154,9 @@
|
||||
#include "chrome/browser/chromeos/fileapi/file_system_backend.h"
|
||||
#include "chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.h"
|
||||
#include "chrome/browser/chromeos/login/startup_utils.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/system/input_device_settings.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#elif defined(OS_LINUX)
|
||||
#include "chrome/browser/chrome_browser_main_linux.h"
|
||||
#elif defined(OS_ANDROID)
|
||||
@ -390,7 +390,7 @@ bool HandleWebUI(GURL* url, content::BrowserContext* browser_context) {
|
||||
// Special case : in ChromeOS in Guest mode bookmarks and history are
|
||||
// disabled for security reasons. New tab page explains the reasons, so
|
||||
// we redirect user to new tab page.
|
||||
if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) {
|
||||
if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) {
|
||||
if (url->SchemeIs(content::kChromeUIScheme) &&
|
||||
(url->DomainIs(chrome::kChromeUIBookmarksHost) ||
|
||||
url->DomainIs(chrome::kChromeUIHistoryHost))) {
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host.h"
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
|
||||
#include "chrome/browser/chromeos/login/ui/webui_login_view.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/extensions/component_loader.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
@ -48,6 +47,7 @@
|
||||
#include "chromeos/audio/chromeos_sounds.h"
|
||||
#include "chromeos/ime/input_method_manager.h"
|
||||
#include "chromeos/login/login_state.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_accessibility_state.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_details.h"
|
||||
@ -469,9 +469,8 @@ void AccessibilityManager::UpdateLargeCursorFromPref() {
|
||||
}
|
||||
|
||||
bool AccessibilityManager::IsIncognitoAllowed() {
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
// Supervised users can't create incognito-mode windows.
|
||||
return !(user_manager->IsLoggedInAsSupervisedUser());
|
||||
return !(user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser());
|
||||
}
|
||||
|
||||
bool AccessibilityManager::IsLargeCursorEnabled() {
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
|
||||
#include "chrome/browser/chromeos/login/helper.h"
|
||||
#include "chrome/browser/chromeos/login/login_utils.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/preferences.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/extensions/api/braille_display_private/mock_braille_controller.h"
|
||||
@ -28,6 +27,7 @@
|
||||
#include "chromeos/ime/component_extension_ime_manager.h"
|
||||
#include "chromeos/ime/input_method_manager.h"
|
||||
#include "chromeos/login/user_names.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
@ -272,7 +272,8 @@ IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, Login) {
|
||||
EXPECT_EQ(default_autoclick_delay(), GetAutoclickDelay());
|
||||
|
||||
// Logs in.
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
|
||||
// Confirms that the features still disabled just after login.
|
||||
EXPECT_FALSE(IsLargeCursorEnabled());
|
||||
@ -282,7 +283,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, Login) {
|
||||
EXPECT_FALSE(IsVirtualKeyboardEnabled());
|
||||
EXPECT_EQ(default_autoclick_delay(), GetAutoclickDelay());
|
||||
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that the features are still disabled just after login.
|
||||
EXPECT_FALSE(IsLargeCursorEnabled());
|
||||
@ -333,8 +334,9 @@ IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, BrailleOnLoginScreen) {
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, TypePref) {
|
||||
// Logs in.
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that the features are disabled just after login.
|
||||
EXPECT_FALSE(IsLargeCursorEnabled());
|
||||
@ -392,7 +394,8 @@ IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, TypePref) {
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, ResumeSavedPref) {
|
||||
// Loads the profile of the user.
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
|
||||
// Sets the pref to enable large cursor before login.
|
||||
SetLargeCursorEnabledPref(true);
|
||||
@ -420,7 +423,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, ResumeSavedPref) {
|
||||
EXPECT_FALSE(IsVirtualKeyboardEnabled());
|
||||
|
||||
// Logs in.
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that features are enabled by restoring from pref just after login.
|
||||
EXPECT_TRUE(IsLargeCursorEnabled());
|
||||
@ -436,8 +439,9 @@ IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest,
|
||||
MockAccessibilityObserver observer;
|
||||
|
||||
// Logs in.
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
EXPECT_FALSE(observer.observed());
|
||||
observer.reset();
|
||||
@ -495,8 +499,9 @@ IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest,
|
||||
MockAccessibilityObserver observer;
|
||||
|
||||
// Logs in.
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
EXPECT_FALSE(observer.observed());
|
||||
observer.reset();
|
||||
@ -588,7 +593,7 @@ IN_PROC_BROWSER_TEST_P(AccessibilityManagerUserTypeTest,
|
||||
|
||||
// Logs in.
|
||||
const char* user_name = GetParam();
|
||||
UserManager::Get()->UserLoggedIn(user_name, user_name, true);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(user_name, user_name, true);
|
||||
|
||||
// Confirms that the features are still enabled just after login.
|
||||
EXPECT_TRUE(IsLargeCursorEnabled());
|
||||
@ -597,7 +602,7 @@ IN_PROC_BROWSER_TEST_P(AccessibilityManagerUserTypeTest,
|
||||
EXPECT_TRUE(IsAutoclickEnabled());
|
||||
EXPECT_EQ(kTestAutoclickDelayMs, GetAutoclickDelay());
|
||||
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that the features keep enabled after session starts.
|
||||
EXPECT_TRUE(IsLargeCursorEnabled());
|
||||
@ -617,13 +622,14 @@ IN_PROC_BROWSER_TEST_P(AccessibilityManagerUserTypeTest,
|
||||
IN_PROC_BROWSER_TEST_P(AccessibilityManagerUserTypeTest, BrailleWhenLoggedIn) {
|
||||
// Logs in.
|
||||
const char* user_name = GetParam();
|
||||
UserManager::Get()->UserLoggedIn(user_name, user_name, true);
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->UserLoggedIn(user_name, user_name, true);
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
// This object watches for IME preference changes and reflects those in
|
||||
// the IME framework state.
|
||||
chromeos::Preferences prefs;
|
||||
prefs.InitUserPrefsForTesting(PrefServiceSyncable::FromProfile(GetProfile()),
|
||||
UserManager::Get()->GetActiveUser());
|
||||
prefs.InitUserPrefsForTesting(
|
||||
PrefServiceSyncable::FromProfile(GetProfile()),
|
||||
user_manager::UserManager::Get()->GetActiveUser());
|
||||
|
||||
// Make sure we start in the expected state.
|
||||
EXPECT_FALSE(IsBrailleImeActive());
|
||||
@ -660,8 +666,9 @@ IN_PROC_BROWSER_TEST_P(AccessibilityManagerUserTypeTest, BrailleWhenLoggedIn) {
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, AcessibilityMenuVisibility) {
|
||||
// Log in.
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that the features are disabled.
|
||||
EXPECT_FALSE(IsLargeCursorEnabled());
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "base/prefs/pref_service.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
|
||||
#include "chrome/browser/chromeos/login/helper.h"
|
||||
#include "chrome/browser/chromeos/login/login_utils.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
@ -22,6 +21,7 @@
|
||||
#include "chrome/test/base/in_process_browser_test.h"
|
||||
#include "chrome/test/base/testing_profile.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "components/user_prefs/user_prefs.h"
|
||||
#include "content/public/browser/notification_details.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
@ -96,7 +96,7 @@ bool GetScreenMagnifierEnabledFromPref() {
|
||||
// the profile is regarded as "non new" in the next login. This is used in
|
||||
// PRE_XXX cases so that in the main XXX case we can test non new profiles.
|
||||
void PrepareNonNewProfile(const std::string& name) {
|
||||
UserManager::Get()->UserLoggedIn(name, name, true);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(name, name, true);
|
||||
// To prepare a non-new profile for tests, we must ensure the profile
|
||||
// directory and the preference files are created, because that's what
|
||||
// Profile::IsNewProfile() checks. UserLoggedIn(), however, does not yet
|
||||
@ -184,12 +184,13 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginOffToOff) {
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
|
||||
// Logs in with existing profile.
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
|
||||
// Confirms that magnifier is still disabled just after login.
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that magnifier is still disabled just after session starts.
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
@ -223,13 +224,14 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToOff) {
|
||||
EXPECT_EQ(2.5, GetFullScreenMagnifierScale());
|
||||
|
||||
// Logs in (but the session is not started yet).
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
|
||||
// Confirms that magnifier is keeping enabled.
|
||||
EXPECT_TRUE(IsMagnifierEnabled());
|
||||
EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType());
|
||||
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that magnifier is disabled just after session start.
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
@ -252,12 +254,13 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginOffToFull) {
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
|
||||
// Logs in (but the session is not started yet).
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
|
||||
// Confirms that magnifier is keeping disabled.
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that the magnifier is enabled and configured according to the
|
||||
// explicitly set prefs just after session start.
|
||||
@ -287,13 +290,14 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToFull) {
|
||||
EXPECT_EQ(3.0, GetFullScreenMagnifierScale());
|
||||
|
||||
// Logs in (but the session is not started yet).
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
|
||||
// Confirms that magnifier is keeping enabled.
|
||||
EXPECT_TRUE(IsMagnifierEnabled());
|
||||
EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType());
|
||||
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that the magnifier is enabled and configured according to the
|
||||
// explicitly set prefs just after session start.
|
||||
@ -316,13 +320,14 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToUnset) {
|
||||
EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType());
|
||||
|
||||
// Logs in (but the session is not started yet).
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
|
||||
// Confirms that magnifier is keeping enabled.
|
||||
EXPECT_TRUE(IsMagnifierEnabled());
|
||||
EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType());
|
||||
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that magnifier is disabled.
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
@ -337,12 +342,13 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserOff) {
|
||||
SetMagnifierEnabled(false);
|
||||
|
||||
// Logs in (but the session is not started yet).
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
|
||||
// Confirms that magnifier is keeping disabled.
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that magnifier is keeping disabled.
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
@ -359,13 +365,14 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserFull) {
|
||||
EXPECT_EQ(2.5, GetFullScreenMagnifierScale());
|
||||
|
||||
// Logs in (but the session is not started yet).
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
|
||||
// Confirms that magnifier is keeping enabled.
|
||||
EXPECT_TRUE(IsMagnifierEnabled());
|
||||
EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType());
|
||||
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that magnifier keeps enabled.
|
||||
EXPECT_TRUE(IsMagnifierEnabled());
|
||||
@ -379,12 +386,13 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserUnset) {
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
|
||||
// Logs in (but the session is not started yet).
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
|
||||
// Confirms that magnifier is keeping disabled.
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that magnifier is keeping disabled.
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
@ -450,8 +458,9 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, ChangeMagnifierType) {
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, TypePref) {
|
||||
// Logs in
|
||||
UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true);
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kTestUserName, kTestUserName, true);
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Confirms that magnifier is disabled just after login.
|
||||
EXPECT_FALSE(IsMagnifierEnabled());
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "chrome/browser/chromeos/app_mode/kiosk_app_update_service.h"
|
||||
#include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.h"
|
||||
#include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
|
||||
#include "chrome/browser/lifetime/application_lifetime.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
@ -27,6 +26,7 @@
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chromeos/network/network_state.h"
|
||||
#include "chromeos/network/network_state_handler.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
|
||||
using apps::AppWindowRegistry;
|
||||
@ -54,7 +54,7 @@ class AppWindowHandler : public AppWindowRegistry::Observer {
|
||||
virtual void OnAppWindowRemoved(apps::AppWindow* app_window) OVERRIDE {
|
||||
if (window_registry_->app_windows().empty()) {
|
||||
if (DemoAppLauncher::IsDemoAppSession(
|
||||
chromeos::UserManager::Get()->GetActiveUser()->email())) {
|
||||
user_manager::UserManager::Get()->GetActiveUser()->email())) {
|
||||
// If we were in demo mode, we disabled all our network technologies,
|
||||
// re-enable them.
|
||||
NetworkStateHandler* handler =
|
||||
@ -129,7 +129,7 @@ void InitAppSession(Profile* profile, const std::string& app_id) {
|
||||
// For a demo app, we don't need to either setup the update service or
|
||||
// the idle app name notification.
|
||||
if (DemoAppLauncher::IsDemoAppSession(
|
||||
chromeos::UserManager::Get()->GetActiveUser()->email()))
|
||||
user_manager::UserManager::Get()->GetActiveUser()->email()))
|
||||
return;
|
||||
|
||||
// Set the app_id for the current instance of KioskAppUpdateService.
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "chrome/browser/chromeos/app_mode/kiosk_app_data.h"
|
||||
#include "chrome/browser/chromeos/app_mode/kiosk_app_external_loader.h"
|
||||
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
|
||||
#include "chrome/browser/chromeos/policy/device_local_account.h"
|
||||
#include "chrome/browser/chromeos/settings/cros_settings.h"
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/logging.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/ui/idle_app_name_notification_view.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chromeos/dbus/dbus_thread_manager.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "ui/wm/core/user_activity_detector.h"
|
||||
|
||||
@ -68,7 +68,7 @@ KioskModeIdleAppNameNotification::~KioskModeIdleAppNameNotification() {
|
||||
}
|
||||
|
||||
void KioskModeIdleAppNameNotification::Setup() {
|
||||
DCHECK(UserManager::Get()->IsUserLoggedIn());
|
||||
DCHECK(user_manager::UserManager::Get()->IsUserLoggedIn());
|
||||
Start();
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
|
||||
#include "chrome/browser/chromeos/app_mode/kiosk_diagnosis_runner.h"
|
||||
#include "chrome/browser/chromeos/login/session/user_session_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/extensions/install_tracker.h"
|
||||
#include "chrome/browser/extensions/install_tracker_factory.h"
|
||||
@ -30,6 +29,7 @@
|
||||
#include "chrome/common/extensions/manifest_url_handler.h"
|
||||
#include "components/signin/core/browser/profile_oauth2_token_service.h"
|
||||
#include "components/signin/core/browser/signin_manager.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
@ -333,7 +333,7 @@ void StartupAppLauncher::LaunchApp() {
|
||||
NEW_WINDOW));
|
||||
InitAppSession(profile_, app_id_);
|
||||
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_KIOSK_APP_LAUNCHED,
|
||||
|
@ -37,7 +37,6 @@ class PrefRegistrySyncable;
|
||||
namespace chromeos {
|
||||
|
||||
class CryptohomeClient;
|
||||
class UserManager;
|
||||
|
||||
namespace attestation {
|
||||
|
||||
|
@ -12,12 +12,12 @@
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h"
|
||||
#include "chrome/browser/chromeos/login/startup_utils.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
|
||||
#include "chrome/browser/chromeos/login/wizard_controller.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "chromeos/login/login_state.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
|
||||
namespace chromeos {
|
||||
@ -106,7 +106,7 @@ class UserWallpaperDelegate : public ash::UserWallpaperDelegate {
|
||||
return false;
|
||||
}
|
||||
const user_manager::User* user =
|
||||
chromeos::UserManager::Get()->GetActiveUser();
|
||||
user_manager::UserManager::Get()->GetActiveUser();
|
||||
if (!user)
|
||||
return false;
|
||||
if (chromeos::WallpaperManager::Get()->IsPolicyControlled(user->email()))
|
||||
|
@ -27,12 +27,12 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/login/auth/authentication_notification_details.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/ui/browser.h"
|
||||
#include "chrome/browser/ui/browser_iterator.h"
|
||||
#include "chrome/browser/ui/tabs/tab_strip_model.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/navigation_controller.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
@ -514,7 +514,7 @@ void BootTimesLoader::Observe(
|
||||
if (render_widget_hosts_loading_.find(rwh) !=
|
||||
render_widget_hosts_loading_.end()) {
|
||||
AddLoginTimeMarker("TabPaint: " + GetTabUrl(rwh), false);
|
||||
LoginDone(UserManager::Get()->IsCurrentUserNew());
|
||||
LoginDone(user_manager::UserManager::Get()->IsCurrentUserNew());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@
|
||||
#include "chrome/browser/chromeos/login/login_wizard.h"
|
||||
#include "chrome/browser/chromeos/login/session/user_session_manager.h"
|
||||
#include "chrome/browser/chromeos/login/startup_utils.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
|
||||
#include "chrome/browser/chromeos/login/wizard_controller.h"
|
||||
#include "chrome/browser/chromeos/memory/oom_priority_manager.h"
|
||||
@ -107,6 +107,7 @@
|
||||
#include "components/metrics/metrics_service.h"
|
||||
#include "components/session_manager/core/session_manager.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/browser/power_save_blocker.h"
|
||||
@ -341,7 +342,7 @@ void ChromeBrowserMainPartsChromeos::PreProfileInit() {
|
||||
// -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun()
|
||||
// -- just before CreateProfile().
|
||||
|
||||
UserManager::Initialize();
|
||||
g_browser_process->platform_part()->InitializeChromeUserManager();
|
||||
|
||||
// Initialize the screen locker now so that it can receive
|
||||
// LOGIN_USER_CHANGED notification from UserManager.
|
||||
@ -415,7 +416,7 @@ void ChromeBrowserMainPartsChromeos::PreProfileInit() {
|
||||
if (immediate_login) {
|
||||
const std::string user_id = login::CanonicalizeUserID(
|
||||
parsed_command_line().GetSwitchValueASCII(switches::kLoginUser));
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
|
||||
if (policy::IsDeviceLocalAccountUser(user_id, NULL) &&
|
||||
!user_manager->IsKnownUser(user_id)) {
|
||||
@ -530,7 +531,7 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() {
|
||||
|
||||
// Guest user profile is never initialized with locale settings,
|
||||
// so we need special handling for Guest session.
|
||||
if (UserManager::Get()->IsLoggedInAsGuest())
|
||||
if (user_manager::UserManager::Get()->IsLoggedInAsGuest())
|
||||
SetGuestLocale(profile());
|
||||
|
||||
// These observers must be initialized after the profile because
|
||||
@ -692,7 +693,7 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() {
|
||||
// of the CrosSettings singleton before it is destroyed. This also ensures
|
||||
// that the UserManager has no URLRequest pending (see
|
||||
// http://crbug.com/276659).
|
||||
UserManager::Get()->Shutdown();
|
||||
g_browser_process->platform_part()->user_manager()->Shutdown();
|
||||
WallpaperManager::Get()->Shutdown();
|
||||
|
||||
// Let the AutomaticRebootManager unregister itself as an observer of several
|
||||
@ -724,7 +725,7 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() {
|
||||
// parts of WebUI depends on NetworkPortalDetector.
|
||||
NetworkPortalDetector::Shutdown();
|
||||
|
||||
UserManager::Destroy();
|
||||
g_browser_process->platform_part()->DestroyChromeUserManager();
|
||||
|
||||
g_browser_process->platform_part()->ShutdownSessionManager();
|
||||
}
|
||||
|
@ -17,8 +17,8 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/values.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "third_party/cros_system_api/dbus/service_constants.h"
|
||||
#include "ui/gfx/display.h"
|
||||
#include "ui/gfx/insets.h"
|
||||
@ -98,7 +98,7 @@ ash::DisplayManager* GetDisplayManager() {
|
||||
// Returns true id the current user can write display preferences to
|
||||
// Local State.
|
||||
bool UserCanSaveDisplayPreference() {
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
return user_manager->IsUserLoggedIn() &&
|
||||
(user_manager->IsLoggedInAsRegularUser() ||
|
||||
user_manager->IsLoggedInAsSupervisedUser() ||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "base/values.h"
|
||||
#include "chrome/browser/chromeos/display/display_configuration_observer.h"
|
||||
#include "chrome/browser/chromeos/login/users/mock_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chrome/test/base/testing_browser_process.h"
|
||||
#include "ui/display/chromeos/display_configurator.h"
|
||||
|
@ -6,13 +6,13 @@
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/test/base/in_process_browser_test.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "chromeos/login/user_names.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace drive {
|
||||
@ -52,7 +52,7 @@ class DriveNotificationManagerFactoryGuestBrowserTest
|
||||
// profile or the guest profile while a guest session is in progress.
|
||||
IN_PROC_BROWSER_TEST_F(DriveNotificationManagerFactoryGuestBrowserTest,
|
||||
NoDriveNotificationManager) {
|
||||
chromeos::UserManager* user_manager = chromeos::UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
EXPECT_TRUE(user_manager->IsLoggedInAsGuest());
|
||||
Profile* guest_profile =
|
||||
chromeos::ProfileHelper::Get()
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chrome/common/url_constants.h"
|
||||
#include "chromeos/chromeos_constants.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "net/base/escape.h"
|
||||
#include "webkit/browser/fileapi/file_system_url.h"
|
||||
@ -121,7 +122,7 @@ base::FilePath GetDriveMountPointPath(Profile* profile) {
|
||||
// returns currently active users's hash in such a case.) I still try
|
||||
// ProfileHelper first because it works better in tests.
|
||||
user_manager::User* const user =
|
||||
chromeos::UserManager::IsInitialized()
|
||||
user_manager::UserManager::IsInitialized()
|
||||
? chromeos::ProfileHelper::Get()->GetUserByProfile(
|
||||
profile->GetOriginalProfile())
|
||||
: NULL;
|
||||
|
@ -16,12 +16,12 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/sys_info.h"
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "chromeos/ime/ime_keyboard.h"
|
||||
#include "chromeos/ime/input_method_manager.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "ui/events/event.h"
|
||||
#include "ui/events/event_utils.h"
|
||||
#include "ui/events/keycodes/keyboard_code_conversion.h"
|
||||
@ -510,7 +510,7 @@ void EventRewriter::RewriteModifierKeys(const ui::KeyEvent& key_event,
|
||||
// TODO(glotov): remove the following condition when we do not restart chrome
|
||||
// when user logs in as guest.
|
||||
// TODO(kpschoedel): check whether this is still necessary.
|
||||
if (UserManager::Get()->IsLoggedInAsGuest() &&
|
||||
if (user_manager::UserManager::Get()->IsLoggedInAsGuest() &&
|
||||
LoginDisplayHostImpl::default_host())
|
||||
return;
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "chrome/browser/chromeos/input_method/input_method_configuration.h"
|
||||
#include "chrome/browser/chromeos/input_method/mock_input_method_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/mock_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
||||
#include "chrome/browser/chromeos/preferences.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chrome/test/base/testing_pref_service_syncable.h"
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "chrome/browser/chromeos/events/keyboard_driven_event_rewriter.h"
|
||||
|
||||
#include "chrome/browser/chromeos/events/event_rewriter.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/system/input_device_settings.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "ui/events/event.h"
|
||||
#include "ui/events/event_utils.h"
|
||||
|
||||
@ -19,8 +19,8 @@ const int kModifierMask = ui::EF_SHIFT_DOWN;
|
||||
// Returns true if and only if it is on login screen (i.e. user is not logged
|
||||
// in) and the keyboard driven flag in the OEM manifest is on.
|
||||
bool ShouldStripModifiersForArrowKeysAndEnter() {
|
||||
if (UserManager::IsInitialized() &&
|
||||
!UserManager::Get()->IsSessionStarted()) {
|
||||
if (user_manager::UserManager::IsInitialized() &&
|
||||
!user_manager::UserManager::Get()->IsSessionStarted()) {
|
||||
return system::InputDeviceSettings::Get()
|
||||
->ForceKeyboardDrivenUINavigation();
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h"
|
||||
#include "chrome/browser/chromeos/file_manager/app_installer.h"
|
||||
#include "chrome/browser/chromeos/file_manager/zip_file_creator.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/chromeos/settings/cros_settings.h"
|
||||
#include "chrome/browser/devtools/devtools_window.h"
|
||||
@ -36,6 +35,7 @@
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/signin/core/browser/profile_oauth2_token_service.h"
|
||||
#include "components/signin/core/browser/signin_manager.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/common/page_zoom.h"
|
||||
@ -63,7 +63,7 @@ apps::AppWindow* GetCurrentAppWindow(ChromeSyncExtensionFunction* function) {
|
||||
|
||||
std::vector<linked_ptr<api::file_browser_private::ProfileInfo> >
|
||||
GetLoggedInProfileInfoList(content::WebContents* contents) {
|
||||
DCHECK(chromeos::UserManager::IsInitialized());
|
||||
DCHECK(user_manager::UserManager::IsInitialized());
|
||||
const std::vector<Profile*>& profiles =
|
||||
g_browser_process->profile_manager()->GetLoadedProfiles();
|
||||
std::set<Profile*> original_profiles;
|
||||
@ -112,7 +112,7 @@ bool FileBrowserPrivateLogoutUserForReauthenticationFunction::RunSync() {
|
||||
user_manager::User* user =
|
||||
chromeos::ProfileHelper::Get()->GetUserByProfile(GetProfile());
|
||||
if (user) {
|
||||
chromeos::UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
user->email(), user_manager::User::OAUTH2_TOKEN_STATUS_INVALID);
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "chrome/browser/app_mode/app_mode_utils.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chromeos/login/startup_utils.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
|
||||
#include "chrome/browser/chromeos/settings/cros_settings.h"
|
||||
#include "chrome/browser/chromeos/system/timezone_util.h"
|
||||
@ -23,6 +22,7 @@
|
||||
#include "chromeos/settings/cros_settings_names.h"
|
||||
#include "chromeos/system/statistics_provider.h"
|
||||
#include "components/metrics/metrics_service.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "extensions/common/error_utils.h"
|
||||
#include "third_party/cros_system_api/dbus/service_constants.h"
|
||||
|
||||
@ -182,7 +182,7 @@ base::Value* ChromeosInfoPrivateGetFunction::GetValue(
|
||||
return new base::StringValue(base::SysInfo::GetLsbReleaseBoard());
|
||||
} else if (property_name == kPropertyOwner) {
|
||||
return new base::FundamentalValue(
|
||||
chromeos::UserManager::Get()->IsCurrentUserOwner());
|
||||
user_manager::UserManager::Get()->IsCurrentUserOwner());
|
||||
} else if (property_name == kPropertyClientId) {
|
||||
return new base::StringValue(GetClientId());
|
||||
} else if (property_name == kPropertyTimezone) {
|
||||
|
@ -12,13 +12,13 @@
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/threading/worker_pool.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "chrome/common/extensions/extension_constants.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "net/base/load_flags.h"
|
||||
#include "net/http/http_status_code.h"
|
||||
#include "net/url_request/url_fetcher.h"
|
||||
@ -100,9 +100,9 @@ bool WallpaperSetWallpaperFunction::RunAsync() {
|
||||
EXTENSION_FUNCTION_VALIDATE(params_);
|
||||
|
||||
// Gets email address and username hash while at UI thread.
|
||||
user_id_ = chromeos::UserManager::Get()->GetLoggedInUser()->email();
|
||||
user_id_ = user_manager::UserManager::Get()->GetLoggedInUser()->email();
|
||||
user_id_hash_ =
|
||||
chromeos::UserManager::Get()->GetLoggedInUser()->username_hash();
|
||||
user_manager::UserManager::Get()->GetLoggedInUser()->username_hash();
|
||||
|
||||
if (params_->details.wallpaper_data) {
|
||||
StartDecode(*params_->details.wallpaper_data);
|
||||
@ -138,7 +138,7 @@ void WallpaperSetWallpaperFunction::OnWallpaperDecoded(
|
||||
ash::WallpaperLayout layout = wallpaper_api_util::GetLayoutEnum(
|
||||
set_wallpaper::Params::Details::ToString(params_->details.layout));
|
||||
bool update_wallpaper =
|
||||
user_id_ == chromeos::UserManager::Get()->GetActiveUser()->email();
|
||||
user_id_ == user_manager::UserManager::Get()->GetActiveUser()->email();
|
||||
wallpaper_manager->SetCustomWallpaper(user_id_,
|
||||
user_id_hash_,
|
||||
params_->details.name,
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/threading/worker_pool.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
@ -30,6 +29,7 @@
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "chrome/grit/platform_locale_settings.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "extensions/browser/event_router.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
@ -301,7 +301,7 @@ bool WallpaperPrivateSetWallpaperIfExistsFunction::RunAsync() {
|
||||
params = set_wallpaper_if_exists::Params::Create(*args_);
|
||||
EXTENSION_FUNCTION_VALIDATE(params);
|
||||
|
||||
user_id_ = chromeos::UserManager::Get()->GetActiveUser()->email();
|
||||
user_id_ = user_manager::UserManager::Get()->GetActiveUser()->email();
|
||||
|
||||
base::FilePath wallpaper_path;
|
||||
base::FilePath fallback_path;
|
||||
@ -372,11 +372,11 @@ void WallpaperPrivateSetWallpaperIfExistsFunction::OnWallpaperDecoded(
|
||||
wallpaper_private::ToString(params->layout));
|
||||
|
||||
bool update_wallpaper =
|
||||
user_id_ == chromeos::UserManager::Get()->GetActiveUser()->email();
|
||||
user_id_ == user_manager::UserManager::Get()->GetActiveUser()->email();
|
||||
wallpaper_manager->SetWallpaperFromImageSkia(
|
||||
user_id_, image, layout, update_wallpaper);
|
||||
bool is_persistent =
|
||||
!chromeos::UserManager::Get()->IsCurrentUserNonCryptohomeDataEphemeral();
|
||||
bool is_persistent = !user_manager::UserManager::Get()
|
||||
->IsCurrentUserNonCryptohomeDataEphemeral();
|
||||
chromeos::WallpaperInfo info = {params->url, layout,
|
||||
user_manager::User::ONLINE,
|
||||
base::Time::Now().LocalMidnight()};
|
||||
@ -408,7 +408,7 @@ bool WallpaperPrivateSetWallpaperFunction::RunAsync() {
|
||||
EXTENSION_FUNCTION_VALIDATE(params);
|
||||
|
||||
// Gets email address while at UI thread.
|
||||
user_id_ = chromeos::UserManager::Get()->GetActiveUser()->email();
|
||||
user_id_ = user_manager::UserManager::Get()->GetActiveUser()->email();
|
||||
|
||||
StartDecode(params->wallpaper);
|
||||
|
||||
@ -482,12 +482,12 @@ void WallpaperPrivateSetWallpaperFunction::SetDecodedWallpaper(
|
||||
wallpaper_private::ToString(params->layout));
|
||||
|
||||
bool update_wallpaper =
|
||||
user_id_ == chromeos::UserManager::Get()->GetActiveUser()->email();
|
||||
user_id_ == user_manager::UserManager::Get()->GetActiveUser()->email();
|
||||
wallpaper_manager->SetWallpaperFromImageSkia(
|
||||
user_id_, *image.get(), layout, update_wallpaper);
|
||||
|
||||
bool is_persistent =
|
||||
!chromeos::UserManager::Get()->IsCurrentUserNonCryptohomeDataEphemeral();
|
||||
bool is_persistent = !user_manager::UserManager::Get()
|
||||
->IsCurrentUserNonCryptohomeDataEphemeral();
|
||||
chromeos::WallpaperInfo info = {params->url, layout,
|
||||
user_manager::User::ONLINE,
|
||||
base::Time::Now().LocalMidnight()};
|
||||
@ -510,7 +510,7 @@ WallpaperPrivateResetWallpaperFunction::
|
||||
bool WallpaperPrivateResetWallpaperFunction::RunAsync() {
|
||||
chromeos::WallpaperManager* wallpaper_manager =
|
||||
chromeos::WallpaperManager::Get();
|
||||
chromeos::UserManager* user_manager = chromeos::UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
|
||||
std::string user_id = user_manager->GetActiveUser()->email();
|
||||
wallpaper_manager->RemoveUserWallpaperInfo(user_id);
|
||||
@ -544,9 +544,9 @@ bool WallpaperPrivateSetCustomWallpaperFunction::RunAsync() {
|
||||
EXTENSION_FUNCTION_VALIDATE(params);
|
||||
|
||||
// Gets email address and username hash while at UI thread.
|
||||
user_id_ = chromeos::UserManager::Get()->GetActiveUser()->email();
|
||||
user_id_ = user_manager::UserManager::Get()->GetActiveUser()->email();
|
||||
user_id_hash_ =
|
||||
chromeos::UserManager::Get()->GetActiveUser()->username_hash();
|
||||
user_manager::UserManager::Get()->GetActiveUser()->username_hash();
|
||||
|
||||
StartDecode(params->wallpaper);
|
||||
|
||||
@ -571,7 +571,7 @@ void WallpaperPrivateSetCustomWallpaperFunction::OnWallpaperDecoded(
|
||||
wallpaper_private::ToString(params->layout));
|
||||
|
||||
bool update_wallpaper =
|
||||
user_id_ == chromeos::UserManager::Get()->GetActiveUser()->email();
|
||||
user_id_ == user_manager::UserManager::Get()->GetActiveUser()->email();
|
||||
wallpaper_manager->SetCustomWallpaper(user_id_,
|
||||
user_id_hash_,
|
||||
params->file_name,
|
||||
@ -655,9 +655,10 @@ bool WallpaperPrivateSetCustomWallpaperLayoutFunction::RunAsync() {
|
||||
info.layout = wallpaper_api_util::GetLayoutEnum(
|
||||
wallpaper_private::ToString(params->layout));
|
||||
|
||||
std::string email = chromeos::UserManager::Get()->GetActiveUser()->email();
|
||||
bool is_persistent =
|
||||
!chromeos::UserManager::Get()->IsCurrentUserNonCryptohomeDataEphemeral();
|
||||
std::string email =
|
||||
user_manager::UserManager::Get()->GetActiveUser()->email();
|
||||
bool is_persistent = !user_manager::UserManager::Get()
|
||||
->IsCurrentUserNonCryptohomeDataEphemeral();
|
||||
wallpaper_manager->SetUserWallpaperInfo(email, info, is_persistent);
|
||||
wallpaper_manager->UpdateWallpaper(false /* clear_cache */);
|
||||
SendResponse(true);
|
||||
@ -676,7 +677,7 @@ WallpaperPrivateMinimizeInactiveWindowsFunction::
|
||||
|
||||
bool WallpaperPrivateMinimizeInactiveWindowsFunction::RunAsync() {
|
||||
WindowStateManager::MinimizeInactiveWindows(
|
||||
chromeos::UserManager::Get()->GetActiveUser()->username_hash());
|
||||
user_manager::UserManager::Get()->GetActiveUser()->username_hash());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -690,7 +691,7 @@ WallpaperPrivateRestoreMinimizedWindowsFunction::
|
||||
|
||||
bool WallpaperPrivateRestoreMinimizedWindowsFunction::RunAsync() {
|
||||
WindowStateManager::RestoreWindows(
|
||||
chromeos::UserManager::Get()->GetActiveUser()->username_hash());
|
||||
user_manager::UserManager::Get()->GetActiveUser()->username_hash());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -706,7 +707,8 @@ bool WallpaperPrivateGetThumbnailFunction::RunAsync() {
|
||||
EXTENSION_FUNCTION_VALIDATE(params);
|
||||
|
||||
base::FilePath thumbnail_path;
|
||||
std::string email = chromeos::UserManager::Get()->GetActiveUser()->email();
|
||||
std::string email =
|
||||
user_manager::UserManager::Get()->GetActiveUser()->email();
|
||||
if (params->source == get_thumbnail::Params::SOURCE_ONLINE) {
|
||||
std::string file_name = GURL(params->url_or_file).ExtractFileName();
|
||||
CHECK(PathService::Get(chrome::DIR_CHROMEOS_WALLPAPER_THUMBNAILS,
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "chrome/browser/chromeos/extensions/wallpaper_private_api.h"
|
||||
#include "chrome/browser/chromeos/login/users/fake_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
||||
#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
|
||||
#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h"
|
||||
#include "ui/aura/test/test_windows.h"
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "chrome/browser/chromeos/drive/drive_integration_service.h"
|
||||
#include "chrome/browser/chromeos/file_manager/drive_test_util.h"
|
||||
#include "chrome/browser/chromeos/file_manager/volume_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/drive/fake_drive_service.h"
|
||||
#include "chrome/browser/extensions/extension_apitest.h"
|
||||
@ -20,6 +19,7 @@
|
||||
#include "chrome/browser/ui/browser.h"
|
||||
#include "chrome/common/chrome_constants.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
@ -511,9 +511,8 @@ class MultiProfileDriveFileSystemExtensionApiTest :
|
||||
virtual void SetUpOnMainThread() OVERRIDE {
|
||||
base::FilePath user_data_directory;
|
||||
PathService::Get(chrome::DIR_USER_DATA, &user_data_directory);
|
||||
chromeos::UserManager::Get()->UserLoggedIn(kSecondProfileAccount,
|
||||
kSecondProfileHash,
|
||||
false);
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
kSecondProfileAccount, kSecondProfileHash, false);
|
||||
// Set up the secondary profile.
|
||||
base::FilePath profile_dir =
|
||||
user_data_directory.Append(
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "chrome/browser/chromeos/file_manager/drive_test_util.h"
|
||||
#include "chrome/browser/chromeos/file_manager/path_util.h"
|
||||
#include "chrome/browser/chromeos/file_manager/volume_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/drive/fake_drive_service.h"
|
||||
#include "chrome/browser/extensions/component_loader.h"
|
||||
@ -41,6 +40,7 @@
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "extensions/browser/api/test/test_api.h"
|
||||
@ -1131,7 +1131,8 @@ class MultiProfileFileManagerBrowserTest : public FileManagerBrowserTestBase {
|
||||
|
||||
// Adds a new user for testing to the current session.
|
||||
void AddUser(const TestAccountInfo& info, bool log_in) {
|
||||
chromeos::UserManager* const user_manager = chromeos::UserManager::Get();
|
||||
user_manager::UserManager* const user_manager =
|
||||
user_manager::UserManager::Get();
|
||||
if (log_in)
|
||||
user_manager->UserLoggedIn(info.email, info.hash, false);
|
||||
user_manager->SaveUserDisplayName(info.email,
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "base/values.h"
|
||||
#include "chrome/browser/chromeos/drive/file_system_util.h"
|
||||
#include "chrome/browser/chromeos/file_manager/app_id.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
|
||||
#include "chrome/browser/chromeos/settings/cros_settings.h"
|
||||
#include "chrome/browser/chromeos/settings/device_settings_service.h"
|
||||
#include "chrome/browser/drive/drive_app_registry.h"
|
||||
|
@ -8,11 +8,11 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/sys_info.h"
|
||||
#include "chrome/browser/chromeos/drive/file_system_util.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/download/download_prefs.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "net/base/escape.h"
|
||||
|
||||
namespace file_manager {
|
||||
@ -35,12 +35,12 @@ base::FilePath GetDownloadsFolderForProfile(Profile* profile) {
|
||||
// On non-ChromeOS system (test+development), the primary profile uses
|
||||
// $HOME/Downloads for ease for accessing local files for debugging.
|
||||
if (!base::SysInfo::IsRunningOnChromeOS() &&
|
||||
chromeos::UserManager::IsInitialized()) {
|
||||
user_manager::UserManager::IsInitialized()) {
|
||||
const user_manager::User* const user =
|
||||
chromeos::ProfileHelper::Get()->GetUserByProfile(
|
||||
profile->GetOriginalProfile());
|
||||
const user_manager::User* const primary_user =
|
||||
chromeos::UserManager::Get()->GetPrimaryUser();
|
||||
user_manager::UserManager::Get()->GetPrimaryUser();
|
||||
if (user == primary_user)
|
||||
return DownloadPrefs::GetDefaultDownloadDirectory();
|
||||
}
|
||||
@ -76,7 +76,7 @@ bool MigratePathFromOldFormat(Profile* profile,
|
||||
// no-op when multi-profile is enabled. This is necessary for (1) back
|
||||
// migration when multi-profile flag is enabled and then disabled, or (2) in
|
||||
// some edge cases (crbug.com/356322) that u-<hash> path is temporarily used.
|
||||
if (chromeos::UserManager::IsInitialized()) {
|
||||
if (user_manager::UserManager::IsInitialized()) {
|
||||
const user_manager::User* const user =
|
||||
chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
|
||||
if (user) {
|
||||
@ -107,7 +107,7 @@ std::string GetDownloadsMountPointName(Profile* profile) {
|
||||
// are not associated with an user account. In that case, no suffix is added
|
||||
// because such a profile never belongs to a multi-profile session.
|
||||
user_manager::User* const user =
|
||||
chromeos::UserManager::IsInitialized()
|
||||
user_manager::UserManager::IsInitialized()
|
||||
? chromeos::ProfileHelper::Get()->GetUserByProfile(
|
||||
profile->GetOriginalProfile())
|
||||
: NULL;
|
||||
|
@ -11,11 +11,11 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chromeos/file_system_provider/provided_file_system.h"
|
||||
#include "chrome/browser/chromeos/file_system_provider/service.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
|
||||
using content::BrowserThread;
|
||||
@ -51,7 +51,7 @@ base::FilePath GetMountPath(Profile* profile,
|
||||
const std::string& extension_id,
|
||||
const std::string& file_system_id) {
|
||||
user_manager::User* const user =
|
||||
chromeos::UserManager::IsInitialized()
|
||||
user_manager::UserManager::IsInitialized()
|
||||
? chromeos::ProfileHelper::Get()->GetUserByProfile(
|
||||
profile->GetOriginalProfile())
|
||||
: NULL;
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "chrome/browser/chromeos/file_system_provider/service.h"
|
||||
#include "chrome/browser/chromeos/file_system_provider/service_factory.h"
|
||||
#include "chrome/browser/chromeos/login/users/fake_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/test/base/testing_browser_process.h"
|
||||
#include "chrome/test/base/testing_profile.h"
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "chrome/browser/chromeos/file_system_provider/observer.h"
|
||||
#include "chrome/browser/chromeos/file_system_provider/provided_file_system_info.h"
|
||||
#include "chrome/browser/chromeos/login/users/fake_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chrome/test/base/testing_pref_service_syncable.h"
|
||||
#include "chrome/test/base/testing_profile.h"
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "chrome/browser/background/background_contents_service.h"
|
||||
#include "chrome/browser/background/background_contents_service_factory.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/tab_contents/background_contents.h"
|
||||
@ -24,6 +23,7 @@
|
||||
#include "chrome/browser/ui/singleton_tabs.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "chrome/grit/theme_resources.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/navigation_controller.h"
|
||||
#include "content/public/browser/notification_details.h"
|
||||
@ -364,7 +364,7 @@ void DriveFirstRunController::EnableOfflineMode() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UserManager::Get()->IsLoggedInAsRegularUser()) {
|
||||
if (!user_manager::UserManager::Get()->IsLoggedInAsRegularUser()) {
|
||||
LOG(ERROR) << "Attempting to enable offline access "
|
||||
"but not logged in a regular user.";
|
||||
OnOfflineInit(false, OUTCOME_WRONG_USER_TYPE);
|
||||
|
@ -5,16 +5,18 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/metrics/histogram.h"
|
||||
#include "base/prefs/pref_service.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/first_run/first_run_controller.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "chrome/browser/ui/extensions/application_launch.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "components/pref_registry/pref_registry_syncable.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_observer.h"
|
||||
#include "content/public/browser/notification_registrar.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
@ -67,7 +69,7 @@ class DialogLauncher : public content::NotificationObserver {
|
||||
bool launched_in_test = command_line->HasSwitch(::switches::kTestType);
|
||||
bool launched_in_telemetry =
|
||||
command_line->HasSwitch(switches::kOobeSkipPostLogin);
|
||||
bool is_user_new = chromeos::UserManager::Get()->IsCurrentUserNew();
|
||||
bool is_user_new = user_manager::UserManager::Get()->IsCurrentUserNew();
|
||||
bool first_run_forced = command_line->HasSwitch(switches::kForceFirstRunUI);
|
||||
bool first_run_seen =
|
||||
profile_->GetPrefs()->GetBoolean(prefs::kFirstRunTutorialShown);
|
||||
@ -96,9 +98,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
}
|
||||
|
||||
void MaybeLaunchDialogAfterSessionStart() {
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
new DialogLauncher(ProfileHelper::Get()->GetProfileByUserUnsafe(
|
||||
user_manager->GetActiveUser()));
|
||||
user_manager::UserManager::Get()->GetActiveUser()));
|
||||
}
|
||||
|
||||
void LaunchTutorial() {
|
||||
|
@ -13,9 +13,9 @@
|
||||
#include "chrome/browser/chromeos/first_run/steps/app_list_step.h"
|
||||
#include "chrome/browser/chromeos/first_run/steps/help_step.h"
|
||||
#include "chrome/browser/chromeos/first_run/steps/tray_step.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/ui/chrome_pages.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
|
||||
namespace {
|
||||
@ -71,7 +71,7 @@ FirstRunController::FirstRunController()
|
||||
|
||||
void FirstRunController::Init() {
|
||||
start_time_ = base::Time::Now();
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
user_profile_ = ProfileHelper::Get()->GetProfileByUserUnsafe(
|
||||
user_manager->GetActiveUser());
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.h"
|
||||
#include "chrome/browser/chromeos/input_method/input_method_engine.h"
|
||||
#include "chrome/browser/chromeos/language_preferences.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chromeos/ime/component_extension_ime_manager.h"
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chromeos/input_method/input_method_util.h"
|
||||
#include "chrome/browser/chromeos/language_preferences.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
|
@ -11,8 +11,8 @@
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/ui/idle_logout_dialog_view.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_observer.h"
|
||||
#include "content/public/browser/notification_registrar.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
@ -48,7 +48,7 @@ KioskModeIdleLogout::~KioskModeIdleLogout() {
|
||||
}
|
||||
|
||||
void KioskModeIdleLogout::Setup() {
|
||||
if (UserManager::Get()->IsLoggedInAsDemoUser()) {
|
||||
if (user_manager::UserManager::Get()->IsLoggedInAsDemoUser()) {
|
||||
// This means that we're recovering from a crash. The user is already
|
||||
// logged in, so go ahead and start the timer.
|
||||
Start();
|
||||
|
@ -11,8 +11,8 @@
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_registrar.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
@ -64,7 +64,8 @@ TEST_F(KioskModeIdleLogoutTest, DISABLED_CheckObserversBeforeUserLogin) {
|
||||
TEST_F(KioskModeIdleLogoutTest, DISABLED_CheckObserversAfterUserLogin) {
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_LOGIN_USER_CHANGED,
|
||||
content::Source<UserManager>(UserManager::Get()),
|
||||
content::Source<user_manager::UserManager>(
|
||||
user_manager::UserManager::Get()),
|
||||
// Ideally this should be the user logged in, but since we won't really be
|
||||
// checking for the current logged in user in our observer anyway, giving
|
||||
// NoDetails here is fine.
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "base/lazy_instance.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
|
||||
#include "chrome/browser/chromeos/settings/cros_settings.h"
|
||||
#include "chrome/browser/lifetime/application_lifetime.h"
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "net/base/network_change_notifier.h"
|
||||
|
||||
@ -296,7 +297,7 @@ bool AppLaunchController::CanConfigureNetwork() {
|
||||
return true;
|
||||
}
|
||||
|
||||
return !UserManager::Get()->GetOwnerEmail().empty();
|
||||
return !user_manager::UserManager::Get()->GetOwnerEmail().empty();
|
||||
}
|
||||
|
||||
bool AppLaunchController::NeedOwnerAuthToConfigureNetwork() {
|
||||
|
@ -11,13 +11,14 @@
|
||||
#include "chrome/browser/signin/screenlock_bridge.h"
|
||||
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/web_ui.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
||||
namespace chromeos {
|
||||
|
||||
UserManager* AppLaunchSigninScreen::test_user_manager_ = NULL;
|
||||
user_manager::UserManager* AppLaunchSigninScreen::test_user_manager_ = NULL;
|
||||
|
||||
AppLaunchSigninScreen::AppLaunchSigninScreen(
|
||||
OobeUI* oobe_ui, Delegate* delegate)
|
||||
@ -39,7 +40,7 @@ void AppLaunchSigninScreen::Show() {
|
||||
}
|
||||
|
||||
void AppLaunchSigninScreen::InitOwnerUserList() {
|
||||
UserManager* user_manager = GetUserManager();
|
||||
user_manager::UserManager* user_manager = GetUserManager();
|
||||
const std::string& owner_email = user_manager->GetOwnerEmail();
|
||||
const user_manager::UserList& all_users = user_manager->GetUsers();
|
||||
|
||||
@ -57,12 +58,13 @@ void AppLaunchSigninScreen::InitOwnerUserList() {
|
||||
|
||||
// static
|
||||
void AppLaunchSigninScreen::SetUserManagerForTesting(
|
||||
UserManager* user_manager) {
|
||||
user_manager::UserManager* user_manager) {
|
||||
test_user_manager_ = user_manager;
|
||||
}
|
||||
|
||||
UserManager* AppLaunchSigninScreen::GetUserManager() {
|
||||
return test_user_manager_ ? test_user_manager_ : UserManager::Get();
|
||||
user_manager::UserManager* AppLaunchSigninScreen::GetUserManager() {
|
||||
return test_user_manager_ ? test_user_manager_
|
||||
: user_manager::UserManager::Get();
|
||||
}
|
||||
|
||||
void AppLaunchSigninScreen::CancelPasswordChangedFlow() {
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/signin/screenlock_bridge.h"
|
||||
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
|
||||
#include "chromeos/login/auth/auth_status_consumer.h"
|
||||
#include "chromeos/login/auth/authenticator.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
|
||||
namespace chromeos {
|
||||
|
||||
@ -43,11 +43,11 @@ class AppLaunchSigninScreen : public SigninScreenHandlerDelegate,
|
||||
|
||||
void Show();
|
||||
|
||||
static void SetUserManagerForTesting(UserManager* user_manager);
|
||||
static void SetUserManagerForTesting(user_manager::UserManager* user_manager);
|
||||
|
||||
private:
|
||||
void InitOwnerUserList();
|
||||
UserManager* GetUserManager();
|
||||
user_manager::UserManager* GetUserManager();
|
||||
|
||||
// SigninScreenHandlerDelegate implementation:
|
||||
virtual void CancelPasswordChangedFlow() OVERRIDE;
|
||||
@ -96,7 +96,7 @@ class AppLaunchSigninScreen : public SigninScreenHandlerDelegate,
|
||||
// This list should have at most one user, and that user should be the owner.
|
||||
user_manager::UserList owner_user_list_;
|
||||
|
||||
static UserManager* test_user_manager_;
|
||||
static user_manager::UserManager* test_user_manager_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AppLaunchSigninScreen);
|
||||
};
|
||||
|
@ -18,8 +18,8 @@
|
||||
#include "chrome/browser/chromeos/login/supervised/supervised_user_authentication.h"
|
||||
#include "chrome/browser/chromeos/login/supervised/supervised_user_constants.h"
|
||||
#include "chrome/browser/chromeos/login/supervised/supervised_user_login_flow.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
|
||||
#include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
@ -29,6 +29,7 @@
|
||||
#include "chromeos/dbus/session_manager_client.h"
|
||||
#include "chromeos/login/user_names.h"
|
||||
#include "chromeos/settings/cros_settings_names.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/browser/notification_types.h"
|
||||
@ -219,7 +220,7 @@ void LoginPerformer::LoginAsSupervisedUser(
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UserManager::Get()->AreSupervisedUsersAllowed()) {
|
||||
if (!user_manager::UserManager::Get()->AreSupervisedUsersAllowed()) {
|
||||
LOG(ERROR) << "Login attempt of supervised user detected.";
|
||||
delegate_->WhiteListCheckFailed(user_context.GetUserID());
|
||||
return;
|
||||
@ -228,11 +229,11 @@ void LoginPerformer::LoginAsSupervisedUser(
|
||||
SupervisedUserLoginFlow* new_flow =
|
||||
new SupervisedUserLoginFlow(user_context.GetUserID());
|
||||
new_flow->set_host(
|
||||
UserManager::Get()->GetUserFlow(user_context.GetUserID())->host());
|
||||
UserManager::Get()->SetUserFlow(user_context.GetUserID(), new_flow);
|
||||
ChromeUserManager::Get()->GetUserFlow(user_context.GetUserID())->host());
|
||||
ChromeUserManager::Get()->SetUserFlow(user_context.GetUserID(), new_flow);
|
||||
|
||||
SupervisedUserAuthentication* authentication = UserManager::Get()->
|
||||
GetSupervisedUserManager()->GetAuthentication();
|
||||
SupervisedUserAuthentication* authentication =
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->GetAuthentication();
|
||||
|
||||
UserContext user_context_copy = authentication->TransformKey(user_context);
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include "chrome/browser/chromeos/login/auth/mount_manager.h"
|
||||
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
|
||||
namespace chromeos {
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/boot_times_loader.h"
|
||||
#include "chrome/browser/chromeos/login/auth/authentication_notification_details.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/ownership/owner_settings_service.h"
|
||||
#include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h"
|
||||
#include "chrome/browser/chromeos/settings/cros_settings.h"
|
||||
@ -25,6 +24,7 @@
|
||||
#include "chromeos/login/auth/user_context.h"
|
||||
#include "chromeos/login/login_state.h"
|
||||
#include "chromeos/login/user_names.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "components/user_manager/user_type.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
@ -242,12 +242,13 @@ void ParallelAuthenticator::AuthenticateToLogin(
|
||||
Profile* profile,
|
||||
const UserContext& user_context) {
|
||||
authentication_profile_ = profile;
|
||||
current_state_.reset(new AuthAttemptState(
|
||||
user_context,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
false, // unlock
|
||||
false, // online_complete
|
||||
!UserManager::Get()->IsKnownUser(user_context.GetUserID())));
|
||||
current_state_.reset(
|
||||
new AuthAttemptState(user_context,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
false, // unlock
|
||||
false, // online_complete
|
||||
!user_manager::UserManager::Get()->IsKnownUser(
|
||||
user_context.GetUserID())));
|
||||
// Reset the verified flag.
|
||||
owner_is_verified_ = false;
|
||||
|
||||
@ -261,12 +262,13 @@ void ParallelAuthenticator::AuthenticateToLogin(
|
||||
void ParallelAuthenticator::CompleteLogin(Profile* profile,
|
||||
const UserContext& user_context) {
|
||||
authentication_profile_ = profile;
|
||||
current_state_.reset(new AuthAttemptState(
|
||||
user_context,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
true, // unlock
|
||||
false, // online_complete
|
||||
!UserManager::Get()->IsKnownUser(user_context.GetUserID())));
|
||||
current_state_.reset(
|
||||
new AuthAttemptState(user_context,
|
||||
user_manager::USER_TYPE_REGULAR,
|
||||
true, // unlock
|
||||
false, // online_complete
|
||||
!user_manager::UserManager::Get()->IsKnownUser(
|
||||
user_context.GetUserID())));
|
||||
|
||||
// Reset the verified flag.
|
||||
owner_is_verified_ = false;
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "chrome/browser/chromeos/login/auth/mock_url_fetchers.h"
|
||||
#include "chrome/browser/chromeos/login/users/fake_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
||||
#include "chrome/browser/chromeos/ownership/owner_settings_service.h"
|
||||
#include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
@ -35,7 +35,6 @@
|
||||
#include "chromeos/login/auth/mock_auth_status_consumer.h"
|
||||
#include "chromeos/login/auth/test_attempt_state.h"
|
||||
#include "chromeos/login/auth/user_context.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "content/public/test/test_browser_thread_bundle.h"
|
||||
#include "crypto/nss_util_internal.h"
|
||||
#include "crypto/scoped_test_nss_chromeos_user.h"
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "cc/base/switches.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chromeos/boot_times_loader.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/lifetime/application_lifetime.h"
|
||||
#include "chrome/common/chrome_constants.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "chrome/browser/chromeos/login/session/user_session_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/test/base/in_process_browser_test.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "chromeos/dbus/cryptohome_client.h"
|
||||
@ -17,6 +16,7 @@
|
||||
#include "chromeos/dbus/fake_session_manager_client.h"
|
||||
#include "chromeos/dbus/session_manager_client.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "third_party/cros_system_api/dbus/service_constants.h"
|
||||
@ -59,7 +59,7 @@ class CrashRestoreSimpleTest : public InProcessBrowserTest {
|
||||
};
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(CrashRestoreSimpleTest, RestoreSessionForOneUser) {
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
user_manager::User* user = user_manager->GetActiveUser();
|
||||
ASSERT_TRUE(user);
|
||||
EXPECT_EQ(kUserId1, user->email());
|
||||
@ -132,7 +132,7 @@ IN_PROC_BROWSER_TEST_F(CrashRestoreComplexTest, RestoreSessionForThreeUsers) {
|
||||
|
||||
// User that is last in the user sessions map becomes active. This behavior
|
||||
// will become better defined once each user gets a separate user desktop.
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
user_manager::User* user = user_manager->GetActiveUser();
|
||||
ASSERT_TRUE(user);
|
||||
EXPECT_EQ(kUserId3, user->email());
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "chrome/browser/chromeos/app_mode/app_session_lifetime.h"
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host.h"
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/extensions/component_loader.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/lifetime/application_lifetime.h"
|
||||
@ -21,6 +20,7 @@
|
||||
#include "chrome/grit/browser_resources.h"
|
||||
#include "chromeos/network/network_handler.h"
|
||||
#include "chromeos/network/network_state_handler.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "ui/base/window_open_disposition.h"
|
||||
@ -96,7 +96,7 @@ void DemoAppLauncher::OnProfileLoaded(Profile* profile) {
|
||||
profile, extension, extensions::LAUNCH_CONTAINER_WINDOW, NEW_WINDOW));
|
||||
InitAppSession(profile, extension_id);
|
||||
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
LoginDisplayHostImpl::default_host()->Finalize();
|
||||
}
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h"
|
||||
#include "chrome/browser/chromeos/login/test/app_window_waiter.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/extensions/extension_browsertest.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
@ -19,6 +18,7 @@
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "chromeos/network/network_state.h"
|
||||
#include "chromeos/network/network_state_handler.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
@ -35,7 +35,7 @@ base::FilePath GetTestDemoAppPath() {
|
||||
}
|
||||
|
||||
Profile* WaitForProfile() {
|
||||
chromeos::UserManager* user_manager = chromeos::UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
if (!user_manager || !user_manager->IsUserLoggedIn()) {
|
||||
content::WindowedNotificationObserver(
|
||||
chrome::NOTIFICATION_SESSION_STARTED,
|
||||
|
@ -33,7 +33,8 @@
|
||||
#include "chrome/browser/chromeos/login/login_utils.h"
|
||||
#include "chrome/browser/chromeos/login/startup_utils.h"
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/user_flow.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/wizard_controller.h"
|
||||
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
|
||||
#include "chrome/browser/chromeos/policy/device_local_account.h"
|
||||
@ -60,6 +61,7 @@
|
||||
#include "components/policy/core/common/policy_map.h"
|
||||
#include "components/policy/core/common/policy_service.h"
|
||||
#include "components/policy/core/common/policy_types.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "components/user_manager/user_type.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
@ -211,7 +213,7 @@ void ExistingUserController::UpdateLoginDisplay(
|
||||
// TODO(xiyuan): Clean user profile whose email is not in whitelist.
|
||||
bool meets_supervised_requirements =
|
||||
(*it)->GetType() != user_manager::USER_TYPE_SUPERVISED ||
|
||||
UserManager::Get()->AreSupervisedUsersAllowed();
|
||||
user_manager::UserManager::Get()->AreSupervisedUsersAllowed();
|
||||
bool meets_whitelist_requirements =
|
||||
LoginUtils::IsWhitelisted((*it)->email(), NULL) ||
|
||||
(*it)->GetType() != user_manager::USER_TYPE_REGULAR;
|
||||
@ -444,8 +446,8 @@ void ExistingUserController::Login(const UserContext& user_context,
|
||||
void ExistingUserController::PerformLogin(
|
||||
const UserContext& user_context,
|
||||
LoginPerformer::AuthorizationMode auth_mode) {
|
||||
UserManager::Get()->GetUserFlow(last_login_attempt_username_)->
|
||||
set_host(host_);
|
||||
ChromeUserManager::Get()->GetUserFlow(last_login_attempt_username_)->set_host(
|
||||
host_);
|
||||
|
||||
BootTimesLoader::Get()->RecordLoginAttempted();
|
||||
|
||||
@ -490,8 +492,10 @@ void ExistingUserController::LoginAsRetailModeUser() {
|
||||
}
|
||||
|
||||
void ExistingUserController::LoginAsGuest() {
|
||||
if (is_login_in_progress_ || UserManager::Get()->IsUserLoggedIn())
|
||||
if (is_login_in_progress_ ||
|
||||
user_manager::UserManager::Get()->IsUserLoggedIn()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Stop the auto-login timer when attempting login.
|
||||
StopPublicSessionAutoLoginTimer();
|
||||
@ -550,8 +554,10 @@ void ExistingUserController::MigrateUserData(const std::string& old_password) {
|
||||
|
||||
void ExistingUserController::LoginAsPublicSession(
|
||||
const UserContext& user_context) {
|
||||
if (is_login_in_progress_ || UserManager::Get()->IsUserLoggedIn())
|
||||
if (is_login_in_progress_ ||
|
||||
user_manager::UserManager::Get()->IsUserLoggedIn()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Stop the auto-login timer when attempting login.
|
||||
StopPublicSessionAutoLoginTimer();
|
||||
@ -582,7 +588,7 @@ void ExistingUserController::LoginAsPublicSession(
|
||||
// If there is no public account with the given user ID, logging in is not
|
||||
// possible.
|
||||
const user_manager::User* user =
|
||||
UserManager::Get()->FindUser(user_context.GetUserID());
|
||||
user_manager::UserManager::Get()->FindUser(user_context.GetUserID());
|
||||
if (!user || user->GetType() != user_manager::USER_TYPE_PUBLIC_ACCOUNT) {
|
||||
// Re-enable clicking on other windows.
|
||||
login_display_->SetUIEnabled(true);
|
||||
@ -767,8 +773,9 @@ void ExistingUserController::OnAuthFailure(const AuthFailure& failure) {
|
||||
guest_mode_url_ = GURL::EmptyGURL();
|
||||
std::string error = failure.GetErrorString();
|
||||
|
||||
if (UserManager::Get()->GetUserFlow(last_login_attempt_username_)->
|
||||
HandleLoginFailure(failure)) {
|
||||
if (ChromeUserManager::Get()
|
||||
->GetUserFlow(last_login_attempt_username_)
|
||||
->HandleLoginFailure(failure)) {
|
||||
login_display_->SetUIEnabled(true);
|
||||
return;
|
||||
}
|
||||
@ -788,8 +795,8 @@ void ExistingUserController::OnAuthFailure(const AuthFailure& failure) {
|
||||
} else {
|
||||
// Check networking after trying to login in case user is
|
||||
// cached locally or the local admin account.
|
||||
bool is_known_user =
|
||||
UserManager::Get()->IsKnownUser(last_login_attempt_username_);
|
||||
bool is_known_user = user_manager::UserManager::Get()->IsKnownUser(
|
||||
last_login_attempt_username_);
|
||||
if (!network_state_helper_->IsConnected()) {
|
||||
if (is_known_user)
|
||||
ShowError(IDS_LOGIN_ERROR_AUTHENTICATING, error);
|
||||
@ -816,7 +823,7 @@ void ExistingUserController::OnAuthFailure(const AuthFailure& failure) {
|
||||
|
||||
// Reset user flow to default, so that special flow will not affect next
|
||||
// attempt.
|
||||
UserManager::Get()->ResetUserFlow(last_login_attempt_username_);
|
||||
ChromeUserManager::Get()->ResetUserFlow(last_login_attempt_username_);
|
||||
|
||||
if (auth_status_consumer_)
|
||||
auth_status_consumer_->OnAuthFailure(failure);
|
||||
@ -835,8 +842,9 @@ void ExistingUserController::OnAuthSuccess(const UserContext& user_context) {
|
||||
password_changed_ = login_performer_->password_changed();
|
||||
auth_mode_ = login_performer_->auth_mode();
|
||||
|
||||
UserManager::Get()->GetUserFlow(user_context.GetUserID())->
|
||||
HandleLoginSuccess(user_context);
|
||||
ChromeUserManager::Get()
|
||||
->GetUserFlow(user_context.GetUserID())
|
||||
->HandleLoginSuccess(user_context);
|
||||
|
||||
StopPublicSessionAutoLoginTimer();
|
||||
|
||||
@ -854,8 +862,8 @@ void ExistingUserController::OnAuthSuccess(const UserContext& user_context) {
|
||||
|
||||
// Update user's displayed email.
|
||||
if (!display_email_.empty()) {
|
||||
UserManager::Get()->SaveUserDisplayEmail(user_context.GetUserID(),
|
||||
display_email_);
|
||||
user_manager::UserManager::Get()->SaveUserDisplayEmail(
|
||||
user_context.GetUserID(), display_email_);
|
||||
display_email_.clear();
|
||||
}
|
||||
|
||||
@ -870,7 +878,7 @@ void ExistingUserController::OnProfilePrepared(Profile* profile) {
|
||||
// Reenable clicking on other windows and status area.
|
||||
login_display_->SetUIEnabled(true);
|
||||
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
if (user_manager->IsCurrentUserNew() &&
|
||||
user_manager->IsLoggedInAsSupervisedUser()) {
|
||||
// Supervised users should launch into empty desktop on first run.
|
||||
@ -878,7 +886,9 @@ void ExistingUserController::OnProfilePrepared(Profile* profile) {
|
||||
}
|
||||
|
||||
if (user_manager->IsCurrentUserNew() &&
|
||||
!user_manager->GetCurrentUserFlow()->ShouldSkipPostLoginScreens() &&
|
||||
!ChromeUserManager::Get()
|
||||
->GetCurrentUserFlow()
|
||||
->ShouldSkipPostLoginScreens() &&
|
||||
!WizardController::default_controller()->skip_post_login_screens()) {
|
||||
// Don't specify start URLs if the administrator has configured the start
|
||||
// URLs via policy.
|
||||
@ -933,8 +943,9 @@ void ExistingUserController::OnPasswordChangeDetected() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (UserManager::Get()->GetUserFlow(last_login_attempt_username_)->
|
||||
HandlePasswordChangeDetected()) {
|
||||
if (ChromeUserManager::Get()
|
||||
->GetUserFlow(last_login_attempt_username_)
|
||||
->HandlePasswordChangeDetected()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1005,7 +1016,7 @@ void ExistingUserController::OnOnlineChecked(const std::string& username,
|
||||
void ExistingUserController::DeviceSettingsChanged() {
|
||||
if (host_ != NULL) {
|
||||
// Signed settings or user list changed. Notify views and update them.
|
||||
UpdateLoginDisplay(chromeos::UserManager::Get()->GetUsers());
|
||||
UpdateLoginDisplay(user_manager::UserManager::Get()->GetUsers());
|
||||
ConfigurePublicSessionAutoLogin();
|
||||
return;
|
||||
}
|
||||
@ -1047,8 +1058,8 @@ void ExistingUserController::ConfigurePublicSessionAutoLogin() {
|
||||
}
|
||||
}
|
||||
|
||||
const user_manager::User* user =
|
||||
UserManager::Get()->FindUser(public_session_auto_login_username_);
|
||||
const user_manager::User* user = user_manager::UserManager::Get()->FindUser(
|
||||
public_session_auto_login_username_);
|
||||
if (!user || user->GetType() != user_manager::USER_TYPE_PUBLIC_ACCOUNT)
|
||||
public_session_auto_login_username_.clear();
|
||||
|
||||
@ -1114,7 +1125,7 @@ void ExistingUserController::InitializeStartUrls() const {
|
||||
std::vector<std::string> start_urls;
|
||||
|
||||
const base::ListValue *urls;
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
bool can_show_getstarted_guide =
|
||||
user_manager->GetActiveUser()->GetType() ==
|
||||
user_manager::USER_TYPE_REGULAR &&
|
||||
@ -1189,7 +1200,8 @@ void ExistingUserController::ShowError(int error_id,
|
||||
if (error_id == IDS_LOGIN_ERROR_AUTHENTICATING) {
|
||||
if (num_login_attempts_ > 1) {
|
||||
const user_manager::User* user =
|
||||
UserManager::Get()->FindUser(last_login_attempt_username_);
|
||||
user_manager::UserManager::Get()->FindUser(
|
||||
last_login_attempt_username_);
|
||||
if (user && (user->GetType() == user_manager::USER_TYPE_SUPERVISED))
|
||||
error_id = IDS_LOGIN_ERROR_AUTHENTICATING_2ND_TIME_SUPERVISED;
|
||||
}
|
||||
@ -1202,7 +1214,7 @@ void ExistingUserController::ShowGaiaPasswordChanged(
|
||||
const std::string& username) {
|
||||
// Invalidate OAuth token, since it can't be correct after password is
|
||||
// changed.
|
||||
UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
username, user_manager::User::OAUTH2_TOKEN_STATUS_INVALID);
|
||||
|
||||
login_display_->SetUIEnabled(true);
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "chrome/browser/chromeos/login/ui/mock_login_display.h"
|
||||
#include "chrome/browser/chromeos/login/ui/mock_login_display_host.h"
|
||||
#include "chrome/browser/chromeos/login/users/mock_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
||||
#include "chrome/browser/chromeos/policy/device_local_account.h"
|
||||
#include "chrome/browser/chromeos/settings/cros_settings.h"
|
||||
#include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "chrome/browser/chromeos/login/ui/mock_login_display.h"
|
||||
#include "chrome/browser/chromeos/login/ui/mock_login_display_host.h"
|
||||
#include "chrome/browser/chromeos/login/users/mock_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
||||
#include "chrome/browser/chromeos/login/wizard_controller.h"
|
||||
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
|
||||
#include "chrome/browser/chromeos/policy/device_local_account.h"
|
||||
@ -43,6 +43,7 @@
|
||||
#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
|
||||
#include "components/policy/core/common/cloud/policy_builder.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "components/user_manager/user_type.h"
|
||||
#include "content/public/test/mock_notification_observer.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
@ -350,11 +351,12 @@ class ExistingUserControllerPublicSessionTest
|
||||
ExistingUserControllerTest::SetUpOnMainThread();
|
||||
|
||||
// Wait for the public session user to be created.
|
||||
if (!chromeos::UserManager::Get()->IsKnownUser(public_session_user_id_)) {
|
||||
if (!user_manager::UserManager::Get()->IsKnownUser(
|
||||
public_session_user_id_)) {
|
||||
content::WindowedNotificationObserver(
|
||||
chrome::NOTIFICATION_USER_LIST_CHANGED,
|
||||
base::Bind(&chromeos::UserManager::IsKnownUser,
|
||||
base::Unretained(chromeos::UserManager::Get()),
|
||||
base::Bind(&user_manager::UserManager::IsKnownUser,
|
||||
base::Unretained(user_manager::UserManager::Get()),
|
||||
public_session_user_id_)).Wait();
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host.h"
|
||||
#include "chrome/browser/chromeos/login/user_flow.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/first_run/first_run.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
@ -21,6 +21,7 @@
|
||||
#include "chromeos/login/auth/mock_authenticator.h"
|
||||
#include "chromeos/login/auth/user_context.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
@ -37,9 +38,8 @@ void FakeLoginUtils::RespectLocalePreference(Profile*,
|
||||
|
||||
void FakeLoginUtils::DoBrowserLaunch(Profile* profile,
|
||||
LoginDisplayHost* login_host) {
|
||||
|
||||
if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) {
|
||||
UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile);
|
||||
if (!ChromeUserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) {
|
||||
ChromeUserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile);
|
||||
return;
|
||||
}
|
||||
login_host->BeforeSessionStart();
|
||||
@ -58,17 +58,18 @@ void FakeLoginUtils::DoBrowserLaunch(Profile* profile,
|
||||
}
|
||||
if (login_host)
|
||||
login_host->Finalize();
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
}
|
||||
|
||||
void FakeLoginUtils::PrepareProfile(const UserContext& user_context,
|
||||
bool has_cookies,
|
||||
bool has_active_session,
|
||||
LoginUtils::Delegate* delegate) {
|
||||
UserManager::Get()->UserLoggedIn(
|
||||
user_manager::UserManager::Get()->UserLoggedIn(
|
||||
user_context.GetUserID(), user_context.GetUserIDHash(), false);
|
||||
user_manager::User* user =
|
||||
UserManager::Get()->FindUserAndModify(user_context.GetUserID());
|
||||
user_manager::UserManager::Get()->FindUserAndModify(
|
||||
user_context.GetUserID());
|
||||
DCHECK(user);
|
||||
|
||||
// Make sure that we get the real Profile instead of the login Profile.
|
||||
@ -77,11 +78,12 @@ void FakeLoginUtils::PrepareProfile(const UserContext& user_context,
|
||||
profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
|
||||
user_context.GetUserID());
|
||||
|
||||
if (UserManager::Get()->IsLoggedInAsSupervisedUser()) {
|
||||
user_manager::User* active_user = UserManager::Get()->GetActiveUser();
|
||||
if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) {
|
||||
user_manager::User* active_user =
|
||||
user_manager::UserManager::Get()->GetActiveUser();
|
||||
std::string supervised_user_sync_id =
|
||||
UserManager::Get()->GetSupervisedUserManager()->
|
||||
GetUserSyncId(active_user->email());
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->GetUserSyncId(
|
||||
active_user->email());
|
||||
if (supervised_user_sync_id.empty())
|
||||
supervised_user_sync_id = "DUMMY ID";
|
||||
profile->GetPrefs()->SetString(prefs::kSupervisedUserId,
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "ash/shell.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "chrome/grit/theme_resources.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h"
|
||||
#include "chrome/browser/chromeos/login/users/fake_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/mock_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
||||
#include "chrome/browser/chromeos/login/wizard_controller.h"
|
||||
#include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
|
||||
#include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
|
||||
|
@ -30,8 +30,8 @@
|
||||
#include "chrome/browser/chromeos/login/login_utils.h"
|
||||
#include "chrome/browser/chromeos/login/supervised/supervised_user_authentication.h"
|
||||
#include "chrome/browser/chromeos/login/ui/user_adding_screen.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/lifetime/application_lifetime.h"
|
||||
#include "chrome/browser/signin/signin_manager_factory.h"
|
||||
#include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_provider.h"
|
||||
@ -45,6 +45,7 @@
|
||||
#include "chromeos/login/auth/authenticator.h"
|
||||
#include "chromeos/login/auth/extended_authenticator.h"
|
||||
#include "components/signin/core/browser/signin_manager.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "components/user_manager/user_type.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
@ -202,10 +203,11 @@ void ScreenLocker::OnAuthSuccess(const UserContext& user_context) {
|
||||
}
|
||||
|
||||
const user_manager::User* user =
|
||||
UserManager::Get()->FindUser(user_context.GetUserID());
|
||||
user_manager::UserManager::Get()->FindUser(user_context.GetUserID());
|
||||
if (user) {
|
||||
if (!user->is_active())
|
||||
UserManager::Get()->SwitchActiveUser(user_context.GetUserID());
|
||||
user_manager::UserManager::Get()->SwitchActiveUser(
|
||||
user_context.GetUserID());
|
||||
} else {
|
||||
NOTREACHED() << "Logged in user not found.";
|
||||
}
|
||||
@ -253,7 +255,7 @@ void ScreenLocker::Authenticate(const UserContext& user_context) {
|
||||
if (const user_manager::User* user =
|
||||
FindUnlockUser(user_context.GetUserID())) {
|
||||
if (user->GetType() == user_manager::USER_TYPE_SUPERVISED) {
|
||||
UserContext updated_context = UserManager::Get()
|
||||
UserContext updated_context = ChromeUserManager::Get()
|
||||
->GetSupervisedUserManager()
|
||||
->GetAuthentication()
|
||||
->TransformKey(user_context);
|
||||
@ -348,7 +350,7 @@ void ScreenLocker::HandleLockScreenRequest() {
|
||||
return;
|
||||
}
|
||||
if (g_screen_lock_observer->session_started() &&
|
||||
UserManager::Get()->CanCurrentUserLock()) {
|
||||
user_manager::UserManager::Get()->CanCurrentUserLock()) {
|
||||
ScreenLocker::Show();
|
||||
ash::Shell::GetInstance()->lock_state_controller()->OnStartingLock();
|
||||
} else {
|
||||
@ -370,8 +372,8 @@ void ScreenLocker::Show() {
|
||||
// Check whether the currently logged in user is a guest account and if so,
|
||||
// refuse to lock the screen (crosbug.com/23764).
|
||||
// For a demo user, we should never show the lock screen (crosbug.com/27647).
|
||||
if (UserManager::Get()->IsLoggedInAsGuest() ||
|
||||
UserManager::Get()->IsLoggedInAsDemoUser()) {
|
||||
if (user_manager::UserManager::Get()->IsLoggedInAsGuest() ||
|
||||
user_manager::UserManager::Get()->IsLoggedInAsDemoUser()) {
|
||||
VLOG(1) << "Refusing to lock screen for guest/demo account";
|
||||
return;
|
||||
}
|
||||
@ -390,7 +392,7 @@ void ScreenLocker::Show() {
|
||||
|
||||
if (!screen_locker_) {
|
||||
ScreenLocker* locker =
|
||||
new ScreenLocker(UserManager::Get()->GetUnlockUsers());
|
||||
new ScreenLocker(user_manager::UserManager::Get()->GetUnlockUsers());
|
||||
VLOG(1) << "Created ScreenLocker " << locker;
|
||||
locker->Init();
|
||||
} else {
|
||||
@ -405,8 +407,8 @@ void ScreenLocker::Show() {
|
||||
void ScreenLocker::Hide() {
|
||||
DCHECK(base::MessageLoopForUI::IsCurrent());
|
||||
// For a guest/demo user, screen_locker_ would have never been initialized.
|
||||
if (UserManager::Get()->IsLoggedInAsGuest() ||
|
||||
UserManager::Get()->IsLoggedInAsDemoUser()) {
|
||||
if (user_manager::UserManager::Get()->IsLoggedInAsGuest() ||
|
||||
user_manager::UserManager::Get()->IsLoggedInAsDemoUser()) {
|
||||
VLOG(1) << "Refusing to hide lock screen for guest/demo account";
|
||||
return;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "chrome/browser/chromeos/login/helper.h"
|
||||
#include "chrome/browser/chromeos/login/lock/screen_locker.h"
|
||||
#include "chrome/browser/chromeos/login/ui/webui_login_display.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
|
||||
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
|
||||
#include "chrome/common/url_constants.h"
|
||||
|
@ -10,11 +10,11 @@
|
||||
#include "chrome/browser/chromeos/login/existing_user_controller.h"
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
|
||||
#include "chrome/browser/chromeos/login/ui/webui_login_view.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "chromeos/login/auth/key.h"
|
||||
#include "chromeos/login/auth/user_context.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/test/browser_test_utils.h"
|
||||
@ -68,7 +68,7 @@ bool LoginManagerTest::TryToLogin(const UserContext& user_context) {
|
||||
if (!AddUserToSession(user_context))
|
||||
return false;
|
||||
if (const user_manager::User* active_user =
|
||||
UserManager::Get()->GetActiveUser())
|
||||
user_manager::UserManager::Get()->GetActiveUser())
|
||||
return active_user->email() == user_context.GetUserID();
|
||||
return false;
|
||||
}
|
||||
@ -85,7 +85,7 @@ bool LoginManagerTest::AddUserToSession(const UserContext& user_context) {
|
||||
chrome::NOTIFICATION_SESSION_STARTED,
|
||||
content::NotificationService::AllSources()).Wait();
|
||||
const user_manager::UserList& logged_users =
|
||||
UserManager::Get()->GetLoggedInUsers();
|
||||
user_manager::UserManager::Get()->GetLoggedInUsers();
|
||||
for (user_manager::UserList::const_iterator it = logged_users.begin();
|
||||
it != logged_users.end();
|
||||
++it) {
|
||||
|
@ -4,12 +4,12 @@
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
|
||||
#include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
|
||||
#include "chrome/browser/chromeos/settings/cros_settings.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "chromeos/settings/cros_settings_names.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
@ -31,7 +31,7 @@ class LoginScreenPolicyTest : public policy::DevicePolicyCrosBrowserTest {
|
||||
};
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(LoginScreenPolicyTest, DisableSupervisedUsers) {
|
||||
EXPECT_FALSE(chromeos::UserManager::Get()->AreSupervisedUsersAllowed());
|
||||
EXPECT_FALSE(user_manager::UserManager::Get()->AreSupervisedUsersAllowed());
|
||||
|
||||
scoped_refptr<content::MessageLoopRunner> runner(
|
||||
new content::MessageLoopRunner);
|
||||
@ -46,7 +46,7 @@ IN_PROC_BROWSER_TEST_F(LoginScreenPolicyTest, DisableSupervisedUsers) {
|
||||
|
||||
runner->Run();
|
||||
|
||||
EXPECT_TRUE(chromeos::UserManager::Get()->AreSupervisedUsersAllowed());
|
||||
EXPECT_TRUE(user_manager::UserManager::Get()->AreSupervisedUsersAllowed());
|
||||
}
|
||||
|
||||
} // namespace chromeos
|
||||
|
@ -50,8 +50,9 @@
|
||||
#include "chrome/browser/chromeos/login/startup_utils.h"
|
||||
#include "chrome/browser/chromeos/login/ui/input_events_blocker.h"
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host.h"
|
||||
#include "chrome/browser/chromeos/login/user_flow.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/chromeos/settings/cros_settings.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
@ -80,6 +81,7 @@
|
||||
#include "chromeos/settings/cros_settings_names.h"
|
||||
#include "components/signin/core/browser/signin_manager.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "google_apis/gaia/gaia_auth_consumer.h"
|
||||
@ -106,11 +108,11 @@ CommandLine CreatePerSessionCommandLine(Profile* profile) {
|
||||
// Returns true if restart is needed to apply per-session flags.
|
||||
bool NeedRestartToApplyPerSessionFlags(const CommandLine& user_flags) {
|
||||
// Don't restart browser if it is not first profile in session.
|
||||
if (UserManager::Get()->GetLoggedInUsers().size() != 1)
|
||||
if (user_manager::UserManager::Get()->GetLoggedInUsers().size() != 1)
|
||||
return false;
|
||||
|
||||
// Only restart if needed and if not going into managed mode.
|
||||
if (UserManager::Get()->IsLoggedInAsSupervisedUser())
|
||||
if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser())
|
||||
return false;
|
||||
|
||||
if (about_flags::AreSwitchesIdenticalToCurrentCommandLine(
|
||||
@ -247,8 +249,8 @@ void LoginUtilsImpl::DoBrowserLaunchInternal(Profile* profile,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) {
|
||||
UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile);
|
||||
if (!ChromeUserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) {
|
||||
ChromeUserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -284,9 +286,9 @@ void LoginUtilsImpl::DoBrowserLaunchInternal(Profile* profile,
|
||||
// browser before it is dereferenced by the login host.
|
||||
if (login_host)
|
||||
login_host->Finalize();
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
chromeos::BootTimesLoader::Get()->LoginDone(
|
||||
chromeos::UserManager::Get()->IsCurrentUserNew());
|
||||
user_manager::UserManager::Get()->IsCurrentUserNew());
|
||||
}
|
||||
|
||||
// static
|
||||
@ -365,7 +367,7 @@ bool LoginUtilsImpl::RestartToApplyPerSessionFlagsIfNeed(Profile* profile,
|
||||
flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end());
|
||||
VLOG(1) << "Restarting to apply per-session flags...";
|
||||
DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser(
|
||||
UserManager::Get()->GetActiveUser()->email(), flags);
|
||||
user_manager::UserManager::Get()->GetActiveUser()->email(), flags);
|
||||
AttemptRestart(profile);
|
||||
return true;
|
||||
}
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h"
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
|
||||
#include "chrome/browser/chromeos/login/ui/webui_login_display.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/wizard_controller.h"
|
||||
#include "chrome/browser/chromeos/policy/device_policy_builder.h"
|
||||
#include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
|
||||
@ -49,6 +48,7 @@
|
||||
#include "components/policy/core/common/policy_map.h"
|
||||
#include "components/policy/core/common/policy_types.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/test/browser_test_utils.h"
|
||||
@ -580,7 +580,8 @@ IN_PROC_BROWSER_TEST_F(SamlTest, UseAutenticatedUserEmailAddress) {
|
||||
content::WindowedNotificationObserver(
|
||||
chrome::NOTIFICATION_SESSION_STARTED,
|
||||
content::NotificationService::AllSources()).Wait();
|
||||
const user_manager::User* user = UserManager::Get()->GetActiveUser();
|
||||
const user_manager::User* user =
|
||||
user_manager::UserManager::Get()->GetActiveUser();
|
||||
ASSERT_TRUE(user);
|
||||
EXPECT_EQ(kFirstSAMLUserEmail, user->email());
|
||||
}
|
||||
@ -737,11 +738,11 @@ void SAMLPolicyTest::SetUpOnMainThread() {
|
||||
SamlTest::SetUpOnMainThread();
|
||||
|
||||
// Pretend that the test users' OAuth tokens are valid.
|
||||
UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
kFirstSAMLUserEmail, user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
|
||||
UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
kNonSAMLUserEmail, user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
|
||||
UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
kDifferentDomainSAMLUserEmail,
|
||||
user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
|
||||
}
|
||||
@ -818,7 +819,7 @@ std::string SAMLPolicyTest::GetCookieValue(const std::string& name) {
|
||||
|
||||
void SAMLPolicyTest::GetCookies() {
|
||||
Profile* profile = chromeos::ProfileHelper::Get()->GetProfileByUserUnsafe(
|
||||
UserManager::Get()->GetActiveUser());
|
||||
user_manager::UserManager::Get()->GetActiveUser());
|
||||
ASSERT_TRUE(profile);
|
||||
base::RunLoop run_loop;
|
||||
content::BrowserThread::PostTask(
|
||||
|
@ -13,12 +13,12 @@
|
||||
#include "base/prefs/pref_service.h"
|
||||
#include "base/time/clock.h"
|
||||
#include "base/time/time.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/pref_registry/pref_registry_syncable.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
|
||||
namespace chromeos {
|
||||
|
||||
@ -56,7 +56,7 @@ void SAMLOfflineSigninLimiter::SignedIn(UserContext::AuthFlow auth_flow) {
|
||||
// a SAML IdP. No limit applies in this case. Clear the time of last login
|
||||
// with SAML and the flag enforcing online login, then return.
|
||||
prefs->ClearPref(prefs::kSAMLLastGAIASignInTime);
|
||||
UserManager::Get()->SaveForceOnlineSignin(user_id, false);
|
||||
user_manager::UserManager::Get()->SaveForceOnlineSignin(user_id, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ void SAMLOfflineSigninLimiter::SignedIn(UserContext::AuthFlow auth_flow) {
|
||||
// enforcing online login. The flag will be set again when the limit
|
||||
// expires. If the limit already expired (e.g. because it was set to zero),
|
||||
// the flag will be set again immediately.
|
||||
UserManager::Get()->SaveForceOnlineSignin(user_id, false);
|
||||
user_manager::UserManager::Get()->SaveForceOnlineSignin(user_id, false);
|
||||
prefs->SetInt64(prefs::kSAMLLastGAIASignInTime,
|
||||
clock_->Now().ToInternalValue());
|
||||
}
|
||||
@ -147,7 +147,7 @@ void SAMLOfflineSigninLimiter::ForceOnlineLogin() {
|
||||
return;
|
||||
}
|
||||
|
||||
UserManager::Get()->SaveForceOnlineSignin(user->email(), true);
|
||||
user_manager::UserManager::Get()->SaveForceOnlineSignin(user->email(), true);
|
||||
offline_signin_limit_timer_.reset();
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "base/time/clock.h"
|
||||
#include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory.h"
|
||||
#include "chrome/browser/chromeos/login/users/mock_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chrome/test/base/testing_profile.h"
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "base/values.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/browser_process_platform_part.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
|
||||
#include "chrome/browser/ui/webui/chromeos/login/l10n_util.h"
|
||||
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
|
||||
@ -22,6 +21,7 @@
|
||||
#include "components/policy/core/common/policy_map.h"
|
||||
#include "components/policy/core/common/policy_types.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "components/user_manager/user_type.h"
|
||||
#include "policy/policy_constants.h"
|
||||
|
||||
@ -152,7 +152,8 @@ void ChromeUserSelectionScreen::CheckForPublicSessionLocalePolicyChange(
|
||||
|
||||
void ChromeUserSelectionScreen::SetPublicSessionDisplayName(
|
||||
const std::string& user_id) {
|
||||
const user_manager::User* user = UserManager::Get()->FindUser(user_id);
|
||||
const user_manager::User* user =
|
||||
user_manager::UserManager::Get()->FindUser(user_id);
|
||||
if (!user || user->GetType() != user_manager::USER_TYPE_PUBLIC_ACCOUNT)
|
||||
return;
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "chrome/browser/chromeos/login/login_utils.h"
|
||||
#include "chrome/browser/chromeos/login/screens/screen_observer.h"
|
||||
#include "chrome/browser/chromeos/login/users/avatar/user_image_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/wizard_controller.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/policy/profile_policy_connector.h"
|
||||
@ -34,6 +34,7 @@
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_image/default_user_images.h"
|
||||
#include "components/user_manager/user_image/user_image.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "policy/policy_constants.h"
|
||||
@ -219,11 +220,11 @@ void UserImageScreen::PrepareToShow() {
|
||||
}
|
||||
|
||||
const user_manager::User* UserImageScreen::GetUser() {
|
||||
return UserManager::Get()->GetLoggedInUser();
|
||||
return user_manager::UserManager::Get()->GetLoggedInUser();
|
||||
}
|
||||
|
||||
UserImageManager* UserImageScreen::GetUserImageManager() {
|
||||
return UserManager::Get()->GetUserImageManager(GetUser()->email());
|
||||
return ChromeUserManager::Get()->GetUserImageManager(GetUser()->email());
|
||||
}
|
||||
|
||||
UserImageSyncObserver* UserImageScreen::GetSyncObserver() {
|
||||
|
@ -27,6 +27,8 @@ class PolicyChangeRegistrar;
|
||||
|
||||
namespace chromeos {
|
||||
|
||||
class UserImageManager;
|
||||
|
||||
class UserImageScreen: public WizardScreen,
|
||||
public UserImageScreenActor::Delegate,
|
||||
public ImageDecoder::Delegate,
|
||||
|
@ -14,13 +14,14 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/browser_process_platform_part.h"
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
|
||||
#include "chrome/browser/signin/screenlock_bridge.h"
|
||||
#include "chrome/browser/ui/webui/chromeos/login/l10n_util.h"
|
||||
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "components/user_manager/user_type.h"
|
||||
#include "ui/wm/core/user_activity_detector.h"
|
||||
|
||||
@ -136,7 +137,7 @@ void UserSelectionScreen::FillUserDictionary(
|
||||
// Fill in multi-profiles related fields.
|
||||
if (is_signin_to_add) {
|
||||
MultiProfileUserController* multi_profile_user_controller =
|
||||
UserManager::Get()->GetMultiProfileUserController();
|
||||
ChromeUserManager::Get()->GetMultiProfileUserController();
|
||||
MultiProfileUserController::UserAllowedInSessionReason isUserAllowedReason;
|
||||
bool isUserAllowed = multi_profile_user_controller->IsUserAllowedInSession(
|
||||
user_id, &isUserAllowedReason);
|
||||
@ -299,7 +300,7 @@ void UserSelectionScreen::SendUserList() {
|
||||
// http://crbug.com/230852
|
||||
bool single_user = users.size() == 1;
|
||||
bool is_signin_to_add = LoginDisplayHostImpl::default_host() &&
|
||||
UserManager::Get()->IsUserLoggedIn();
|
||||
user_manager::UserManager::Get()->IsUserLoggedIn();
|
||||
std::string owner;
|
||||
chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner);
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "chrome/browser/chromeos/login/session/login_oobe_session_manager_delegate.h"
|
||||
#include "chrome/browser/chromeos/login/session/restore_after_crash_session_manager_delegate.h"
|
||||
#include "chrome/browser/chromeos/login/session/stub_login_session_manager_delegate.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "chromeos/login/user_names.h"
|
||||
|
@ -7,11 +7,11 @@
|
||||
#include "base/command_line.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/login/session/user_session_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chromeos/audio/cras_audio_handler.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
|
||||
namespace chromeos {
|
||||
@ -48,7 +48,7 @@ void RestoreAfterCrashSessionManagerDelegate::Start() {
|
||||
content::Details<Profile>(profile()));
|
||||
|
||||
// This call will set session state to SESSION_STATE_ACTIVE (same one).
|
||||
UserManager::Get()->SessionStarted();
|
||||
user_manager::UserManager::Get()->SessionStarted();
|
||||
|
||||
// Now is the good time to retrieve other logged in users for this session.
|
||||
// First user has been already marked as logged in and active in
|
||||
|
@ -31,8 +31,8 @@
|
||||
#include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory.h"
|
||||
#include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h"
|
||||
#include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h"
|
||||
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
@ -64,6 +64,7 @@
|
||||
#include "components/session_manager/core/session_manager.h"
|
||||
#include "components/signin/core/browser/signin_manager_base.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "components/user_manager/user_type.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
@ -190,7 +191,7 @@ void UserSessionManager::OverrideHomedir() {
|
||||
// Override user homedir, check for ProfileManager being initialized as
|
||||
// it may not exist in unit tests.
|
||||
if (g_browser_process->profile_manager()) {
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
if (user_manager->GetLoggedInUsers().size() == 1) {
|
||||
base::FilePath homedir = ProfileHelper::GetProfilePathByUserIdHash(
|
||||
user_manager->GetPrimaryUser()->username_hash());
|
||||
@ -248,7 +249,7 @@ void UserSessionManager::StartSession(
|
||||
}
|
||||
|
||||
void UserSessionManager::PerformPostUserLoggedInActions() {
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
if (user_manager->GetLoggedInUsers().size() == 1) {
|
||||
// Owner must be first user in session. DeviceSettingsService can't deal
|
||||
// with multiple user and will mix up ownership, crbug.com/230018.
|
||||
@ -263,7 +264,7 @@ void UserSessionManager::PerformPostUserLoggedInActions() {
|
||||
}
|
||||
|
||||
void UserSessionManager::RestoreAuthenticationSession(Profile* user_profile) {
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
// We need to restore session only for logged in regular (GAIA) users.
|
||||
// Note: stub user is a special case that is used for tests, running
|
||||
// linux_chromeos build on dev workstations w/o user_id parameters.
|
||||
@ -366,7 +367,7 @@ bool UserSessionManager::RespectLocalePreference(
|
||||
if (g_browser_process == NULL)
|
||||
return false;
|
||||
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
if (!user || (user_manager->IsUserLoggedIn() &&
|
||||
user != user_manager->GetPrimaryUser())) {
|
||||
return false;
|
||||
@ -426,7 +427,8 @@ bool UserSessionManager::RespectLocalePreference(
|
||||
//
|
||||
// For Guest mode, user locale preferences will never get initialized.
|
||||
// So input methods should be enabled somewhere.
|
||||
const bool enable_layouts = UserManager::Get()->IsLoggedInAsGuest();
|
||||
const bool enable_layouts =
|
||||
user_manager::UserManager::Get()->IsLoggedInAsGuest();
|
||||
locale_util::SwitchLanguage(pref_locale,
|
||||
enable_layouts,
|
||||
false /* login_layouts_only */,
|
||||
@ -476,8 +478,8 @@ void UserSessionManager::OnSessionRestoreStateChanged(
|
||||
// error. http://crbug.com/295245
|
||||
if (!connection_error) {
|
||||
// We are in one of "done" states here.
|
||||
UserManager::Get()->SaveUserOAuthStatus(
|
||||
UserManager::Get()->GetLoggedInUser()->email(),
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->GetLoggedInUser()->email(),
|
||||
user_status);
|
||||
}
|
||||
|
||||
@ -494,8 +496,8 @@ void UserSessionManager::OnNewRefreshTokenAvaiable(Profile* user_profile) {
|
||||
login_manager->RemoveObserver(this);
|
||||
|
||||
// Mark user auth token status as valid.
|
||||
UserManager::Get()->SaveUserOAuthStatus(
|
||||
UserManager::Get()->GetLoggedInUser()->email(),
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->GetLoggedInUser()->email(),
|
||||
user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
|
||||
|
||||
VLOG(1) << "Exiting after new refresh token fetched";
|
||||
@ -511,7 +513,7 @@ void UserSessionManager::OnConnectionTypeChanged(
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
::switches::kTestName) ||
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch(::switches::kTestType);
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
if (type == net::NetworkChangeNotifier::CONNECTION_NONE ||
|
||||
!user_manager->IsUserLoggedIn() ||
|
||||
!user_manager->IsLoggedInAsRegularUser() ||
|
||||
@ -585,7 +587,7 @@ void UserSessionManager::StartCrosSession() {
|
||||
void UserSessionManager::NotifyUserLoggedIn() {
|
||||
BootTimesLoader* btl = BootTimesLoader::Get();
|
||||
btl->AddLoginTimeMarker("UserLoggedIn-Start", false);
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
user_manager->UserLoggedIn(user_context_.GetUserID(),
|
||||
user_context_.GetUserIDHash(),
|
||||
false);
|
||||
@ -640,20 +642,21 @@ void UserSessionManager::OnProfileCreated(const UserContext& user_context,
|
||||
void UserSessionManager::InitProfilePreferences(
|
||||
Profile* profile,
|
||||
const UserContext& user_context) {
|
||||
if (UserManager::Get()->IsCurrentUserNew()) {
|
||||
if (user_manager::UserManager::Get()->IsCurrentUserNew()) {
|
||||
SetFirstLoginPrefs(profile->GetPrefs(),
|
||||
user_context.GetPublicSessionLocale(),
|
||||
user_context.GetPublicSessionInputMethod());
|
||||
}
|
||||
|
||||
if (UserManager::Get()->IsLoggedInAsSupervisedUser()) {
|
||||
user_manager::User* active_user = UserManager::Get()->GetActiveUser();
|
||||
if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) {
|
||||
user_manager::User* active_user =
|
||||
user_manager::UserManager::Get()->GetActiveUser();
|
||||
std::string supervised_user_sync_id =
|
||||
UserManager::Get()->GetSupervisedUserManager()->
|
||||
GetUserSyncId(active_user->email());
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->GetUserSyncId(
|
||||
active_user->email());
|
||||
profile->GetPrefs()->SetString(prefs::kSupervisedUserId,
|
||||
supervised_user_sync_id);
|
||||
} else if (UserManager::Get()->IsLoggedInAsRegularUser()) {
|
||||
} else if (user_manager::UserManager::Get()->IsLoggedInAsRegularUser()) {
|
||||
// Make sure that the google service username is properly set (we do this
|
||||
// on every sign in, not just the first login, to deal with existing
|
||||
// profiles that might not have it set yet).
|
||||
@ -743,7 +746,7 @@ void UserSessionManager::FinalizePrepareProfile(Profile* profile) {
|
||||
}
|
||||
btl->AddLoginTimeMarker("TPMOwn-End", false);
|
||||
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
if (user_manager->IsLoggedInAsRegularUser()) {
|
||||
SAMLOfflineSigninLimiter* saml_offline_signin_limiter =
|
||||
SAMLOfflineSigninLimiterFactory::GetForProfile(profile);
|
||||
@ -867,8 +870,10 @@ void UserSessionManager::InitRlzImpl(Profile* profile, bool disabled) {
|
||||
// Negative ping delay means to send ping immediately after a first search is
|
||||
// recorded.
|
||||
RLZTracker::InitRlzFromProfileDelayed(
|
||||
profile, UserManager::Get()->IsCurrentUserNew(),
|
||||
ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay)));
|
||||
profile,
|
||||
user_manager::UserManager::Get()->IsCurrentUserNew(),
|
||||
ping_delay < 0,
|
||||
base::TimeDelta::FromMilliseconds(abs(ping_delay)));
|
||||
if (delegate_)
|
||||
delegate_->OnRlzInitialized();
|
||||
#endif
|
||||
@ -909,7 +914,7 @@ void UserSessionManager::OnRestoreActiveSessions(
|
||||
}
|
||||
|
||||
// One profile has been already loaded on browser start.
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
DCHECK(user_manager->GetLoggedInUsers().size() == 1);
|
||||
DCHECK(user_manager->GetActiveUser());
|
||||
std::string active_user_id = user_manager->GetActiveUser()->email();
|
||||
@ -940,7 +945,7 @@ void UserSessionManager::RestorePendingUserSessions() {
|
||||
|
||||
// Check that this user is not logged in yet.
|
||||
user_manager::UserList logged_in_users =
|
||||
UserManager::Get()->GetLoggedInUsers();
|
||||
user_manager::UserManager::Get()->GetLoggedInUsers();
|
||||
bool user_already_logged_in = false;
|
||||
for (user_manager::UserList::const_iterator it = logged_in_users.begin();
|
||||
it != logged_in_users.end();
|
||||
|
@ -7,12 +7,13 @@
|
||||
#include "base/metrics/user_metrics.h"
|
||||
#include "base/metrics/user_metrics_action.h"
|
||||
#include "base/prefs/pref_service.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/browser/sync/profile_sync_service.h"
|
||||
#include "chrome/browser/sync/profile_sync_service_factory.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "components/user_manager/user_type.h"
|
||||
#include "content/public/browser/user_metrics.h"
|
||||
#include "google_apis/gaia/gaia_auth_util.h"
|
||||
@ -44,8 +45,8 @@ void AuthSyncObserver::Shutdown() {
|
||||
}
|
||||
|
||||
void AuthSyncObserver::OnStateChanged() {
|
||||
DCHECK(UserManager::Get()->IsLoggedInAsRegularUser() ||
|
||||
UserManager::Get()->IsLoggedInAsSupervisedUser());
|
||||
DCHECK(user_manager::UserManager::Get()->IsLoggedInAsRegularUser() ||
|
||||
user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser());
|
||||
ProfileSyncService* sync_service =
|
||||
ProfileSyncServiceFactory::GetForProfile(profile_);
|
||||
user_manager::User* user = ProfileHelper::Get()->GetUserByProfile(profile_);
|
||||
@ -65,15 +66,17 @@ void AuthSyncObserver::OnStateChanged() {
|
||||
// TODO(nkostyelv): Change observer after active user has changed.
|
||||
user_manager::User::OAuthTokenStatus old_status =
|
||||
user->oauth_token_status();
|
||||
UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
email, user_manager::User::OAUTH2_TOKEN_STATUS_INVALID);
|
||||
if (user->GetType() == user_manager::USER_TYPE_SUPERVISED &&
|
||||
old_status != user_manager::User::OAUTH2_TOKEN_STATUS_INVALID) {
|
||||
// Attempt to restore token from file.
|
||||
UserManager::Get()->GetSupervisedUserManager()->LoadSupervisedUserToken(
|
||||
profile_,
|
||||
base::Bind(&AuthSyncObserver::OnSupervisedTokenLoaded,
|
||||
base::Unretained(this)));
|
||||
ChromeUserManager::Get()
|
||||
->GetSupervisedUserManager()
|
||||
->LoadSupervisedUserToken(
|
||||
profile_,
|
||||
base::Bind(&AuthSyncObserver::OnSupervisedTokenLoaded,
|
||||
base::Unretained(this)));
|
||||
content::RecordAction(
|
||||
base::UserMetricsAction("ManagedUsers_Chromeos_Sync_Invalidated"));
|
||||
}
|
||||
@ -83,7 +86,7 @@ void AuthSyncObserver::OnStateChanged() {
|
||||
user_manager::User::OAUTH2_TOKEN_STATUS_INVALID) {
|
||||
LOG(ERROR) <<
|
||||
"Got an incorrectly invalidated token case, restoring token status.";
|
||||
UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
user->email(), user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
|
||||
content::RecordAction(
|
||||
base::UserMetricsAction("ManagedUsers_Chromeos_Sync_Recovered"));
|
||||
@ -92,7 +95,7 @@ void AuthSyncObserver::OnStateChanged() {
|
||||
}
|
||||
|
||||
void AuthSyncObserver::OnSupervisedTokenLoaded(const std::string& token) {
|
||||
UserManager::Get()->GetSupervisedUserManager()->ConfigureSyncWithToken(
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->ConfigureSyncWithToken(
|
||||
profile_, token);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "chrome/browser/chromeos/login/signin/merge_session_load_page.h"
|
||||
#include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h"
|
||||
#include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
|
||||
#include "chrome/browser/chromeos/settings/cros_settings.h"
|
||||
#include "chrome/browser/chromeos/settings/device_settings_service.h"
|
||||
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
|
||||
|
@ -16,10 +16,9 @@
|
||||
#include "chrome/browser/chromeos/login/signin/merge_session_xhr_request_waiter.h"
|
||||
#include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h"
|
||||
#include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/common/url_constants.h"
|
||||
#include "components/google/core/browser/google_util.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/resource_controller.h"
|
||||
@ -163,9 +162,9 @@ bool MergeSessionThrottle::ShouldDelayRequest(
|
||||
int render_view_id) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
|
||||
if (!chromeos::UserManager::Get()->IsUserLoggedIn()) {
|
||||
if (!user_manager::UserManager::Get()->IsUserLoggedIn()) {
|
||||
return false;
|
||||
} else if (!chromeos::UserManager::Get()->IsLoggedInAsRegularUser()) {
|
||||
} else if (!user_manager::UserManager::Get()->IsLoggedInAsRegularUser()) {
|
||||
// This is not a regular user session, let's remove the throttle
|
||||
// permanently.
|
||||
if (!AreAllSessionMergedAlready())
|
||||
@ -206,8 +205,8 @@ bool MergeSessionThrottle::ShouldDelayRequest(
|
||||
// In theory this should not happen since we should
|
||||
// kick off the session restore process for the newly added profile
|
||||
// before we attempt loading any page.
|
||||
if (chromeos::UserManager::Get()->IsLoggedInAsRegularUser() &&
|
||||
!chromeos::UserManager::Get()->IsLoggedInAsStub()) {
|
||||
if (user_manager::UserManager::Get()->IsLoggedInAsRegularUser() &&
|
||||
!user_manager::UserManager::Get()->IsLoggedInAsStub()) {
|
||||
LOG(WARNING) << "Loading content for a profile without "
|
||||
<< "session restore?";
|
||||
}
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h"
|
||||
#include "chrome/browser/chromeos/login/signin_specifics.h"
|
||||
#include "chrome/browser/chromeos/login/test/oobe_base_test.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/wizard_controller.h"
|
||||
#include "chrome/browser/extensions/extension_test_message_listener.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
@ -31,6 +30,7 @@
|
||||
#include "chromeos/login/auth/user_context.h"
|
||||
#include "components/signin/core/browser/profile_oauth2_token_service.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/test/browser_test_utils.h"
|
||||
#include "extensions/browser/process_manager.h"
|
||||
@ -192,8 +192,9 @@ class OAuth2Test : public OobeBaseTest {
|
||||
return false;
|
||||
|
||||
if (const user_manager::User* active_user =
|
||||
UserManager::Get()->GetActiveUser())
|
||||
user_manager::UserManager::Get()->GetActiveUser()) {
|
||||
return active_user->email() == username;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -217,7 +218,7 @@ class OAuth2Test : public OobeBaseTest {
|
||||
protected:
|
||||
// OobeBaseTest overrides.
|
||||
virtual Profile* profile() OVERRIDE {
|
||||
if (UserManager::Get()->GetActiveUser())
|
||||
if (user_manager::UserManager::Get()->GetActiveUser())
|
||||
return ProfileManager::GetPrimaryUserProfile();
|
||||
|
||||
return OobeBaseTest::profile();
|
||||
@ -239,7 +240,7 @@ class OAuth2Test : public OobeBaseTest {
|
||||
chrome::NOTIFICATION_SESSION_STARTED,
|
||||
content::NotificationService::AllSources()).Wait();
|
||||
const user_manager::UserList& logged_users =
|
||||
UserManager::Get()->GetLoggedInUsers();
|
||||
user_manager::UserManager::Get()->GetLoggedInUsers();
|
||||
for (user_manager::UserList::const_iterator it = logged_users.begin();
|
||||
it != logged_users.end();
|
||||
++it) {
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "base/prefs/pref_service.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/signin/chrome_signin_client_factory.h"
|
||||
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
|
||||
@ -22,6 +21,7 @@
|
||||
#include "components/signin/core/browser/profile_oauth2_token_service.h"
|
||||
#include "components/signin/core/browser/signin_client.h"
|
||||
#include "components/signin/core/browser/signin_manager.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "google_apis/gaia/gaia_auth_util.h"
|
||||
#include "google_apis/gaia/gaia_constants.h"
|
||||
#include "google_apis/gaia/gaia_urls.h"
|
||||
@ -111,7 +111,7 @@ void OAuth2LoginManager::RestoreSessionFromSavedTokens() {
|
||||
// and OnRefreshTokenAvailable is not called. Flagging it here would
|
||||
// cause user to go through Gaia in next login to obtain a new refresh
|
||||
// token.
|
||||
UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
primary_account_id, user_manager::User::OAUTH_TOKEN_STATUS_UNKNOWN);
|
||||
|
||||
token_service->LoadCredentials(primary_account_id);
|
||||
@ -140,14 +140,14 @@ void OAuth2LoginManager::OnRefreshTokenAvailable(
|
||||
|
||||
// Do not validate tokens for supervised users, as they don't actually have
|
||||
// oauth2 token.
|
||||
if (UserManager::Get()->IsLoggedInAsSupervisedUser()) {
|
||||
if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) {
|
||||
VLOG(1) << "Logged in as supervised user, skip token validation.";
|
||||
return;
|
||||
}
|
||||
// Only restore session cookies for the primary account in the profile.
|
||||
if (GetPrimaryAccountId() == account_id) {
|
||||
// Token is loaded. Undo the flagging before token loading.
|
||||
UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
account_id, user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
|
||||
VerifySessionCookies();
|
||||
}
|
||||
|
@ -13,11 +13,11 @@
|
||||
#include "base/threading/sequenced_worker_pool.h"
|
||||
#include "chrome/browser/chromeos/login/supervised/supervised_user_constants.h"
|
||||
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chromeos/cryptohome/signed_secret.pb.h"
|
||||
#include "chromeos/login/auth/key.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "crypto/hmac.h"
|
||||
#include "crypto/random.h"
|
||||
@ -224,7 +224,7 @@ void SupervisedUserAuthentication::ScheduleSupervisedPasswordChange(
|
||||
const std::string& supervised_user_id,
|
||||
const base::DictionaryValue* password_data) {
|
||||
const user_manager::User* user =
|
||||
UserManager::Get()->FindUser(supervised_user_id);
|
||||
user_manager::UserManager::Get()->FindUser(supervised_user_id);
|
||||
base::FilePath profile_path = ProfileHelper::GetProfilePathByUserIdHash(
|
||||
user->username_hash());
|
||||
JSONFileValueSerializer serializer(profile_path.Append(kPasswordUpdateFile));
|
||||
@ -281,7 +281,8 @@ void SupervisedUserAuthentication::LoadPasswordUpdateData(
|
||||
const std::string& user_id,
|
||||
const PasswordDataCallback& success_callback,
|
||||
const base::Closure& failure_callback) {
|
||||
const user_manager::User* user = UserManager::Get()->FindUser(user_id);
|
||||
const user_manager::User* user =
|
||||
user_manager::UserManager::Get()->FindUser(user_id);
|
||||
base::FilePath profile_path =
|
||||
ProfileHelper::GetProfilePathByUserIdHash(user->username_hash());
|
||||
PostTaskAndReplyWithResult(
|
||||
|
@ -159,7 +159,7 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserTransactionCleanupTest,
|
||||
std::string user_id = registration_utility_stub_->supervised_user_id();
|
||||
|
||||
// Make sure user is already in list.
|
||||
ASSERT_EQ(3UL, UserManager::Get()->GetUsers().size());
|
||||
ASSERT_EQ(3UL, user_manager::UserManager::Get()->GetUsers().size());
|
||||
|
||||
// We wait for token now. Press cancel button at this point.
|
||||
JSEval("$('cancel-add-user-button').click()");
|
||||
@ -171,7 +171,7 @@ IN_PROC_BROWSER_TEST_(
|
||||
SupervisedUserTransactionCleanupTest2,
|
||||
testing::internal::GetTypeId<SupervisedUserTransactionCleanupTest>()) {
|
||||
// Make sure there is no supervised user in list.
|
||||
ASSERT_EQ(2UL, UserManager::Get()->GetUsers().size());
|
||||
ASSERT_EQ(2UL, user_manager::UserManager::Get()->GetUsers().size());
|
||||
}
|
||||
|
||||
} // namespace chromeos
|
||||
|
@ -17,8 +17,8 @@
|
||||
#include "chrome/browser/chromeos/login/auth/mount_manager.h"
|
||||
#include "chrome/browser/chromeos/login/supervised/supervised_user_authentication.h"
|
||||
#include "chrome/browser/chromeos/login/supervised/supervised_user_constants.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/lifetime/application_lifetime.h"
|
||||
#include "chrome/browser/sync/profile_sync_service.h"
|
||||
#include "chrome/browser/sync/profile_sync_service_factory.h"
|
||||
@ -28,6 +28,7 @@
|
||||
#include "chromeos/login/auth/key.h"
|
||||
#include "chromeos/login/auth/user_context.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/user_metrics.h"
|
||||
#include "crypto/random.h"
|
||||
@ -148,7 +149,7 @@ void SupervisedUserCreationControllerNew::StartCreationImpl() {
|
||||
VLOG(1) << " Phase 1 : Prepare keys";
|
||||
|
||||
SupervisedUserManager* manager =
|
||||
UserManager::Get()->GetSupervisedUserManager();
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager();
|
||||
manager->StartCreationTransaction(creation_context_->display_name);
|
||||
|
||||
creation_context_->local_user_id = manager->GenerateUserId();
|
||||
@ -167,7 +168,7 @@ void SupervisedUserCreationControllerNew::StartCreationImpl() {
|
||||
creation_context_->display_name);
|
||||
|
||||
SupervisedUserAuthentication* authentication =
|
||||
UserManager::Get()->GetSupervisedUserManager()->GetAuthentication();
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->GetAuthentication();
|
||||
|
||||
// When importing M35+ users we need only to store data, for all other cases
|
||||
// we need to create some keys.
|
||||
@ -368,14 +369,16 @@ void SupervisedUserCreationControllerNew::OnSupervisedUserFilesStored(
|
||||
}
|
||||
// Assume that new token is valid. It will be automatically invalidated if
|
||||
// sync service fails to use it.
|
||||
UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
creation_context_->local_user_id,
|
||||
user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
|
||||
|
||||
stage_ = TOKEN_WRITTEN;
|
||||
|
||||
timeout_timer_.Stop();
|
||||
UserManager::Get()->GetSupervisedUserManager()->CommitCreationTransaction();
|
||||
ChromeUserManager::Get()
|
||||
->GetSupervisedUserManager()
|
||||
->CommitCreationTransaction();
|
||||
content::RecordAction(
|
||||
base::UserMetricsAction("ManagedMode_LocallyManagedUserCreated"));
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "chrome/browser/chromeos/login/supervised/supervised_user_creation_controller.h"
|
||||
#include "chrome/browser/chromeos/login/supervised/supervised_user_creation_controller_new.h"
|
||||
#include "chrome/browser/chromeos/login/users/avatar/user_image_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/wizard_controller.h"
|
||||
#include "chrome/browser/supervised_user/supervised_user_constants.h"
|
||||
@ -445,8 +446,8 @@ bool SupervisedUserCreationScreen::FindUserByDisplayName(
|
||||
|
||||
void SupervisedUserCreationScreen::ApplyPicture() {
|
||||
std::string user_id = controller_->GetSupervisedUserId();
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
UserImageManager* image_manager = user_manager->GetUserImageManager(user_id);
|
||||
UserImageManager* image_manager =
|
||||
ChromeUserManager::Get()->GetUserImageManager(user_id);
|
||||
switch (selected_image_) {
|
||||
case user_manager::User::USER_IMAGE_EXTERNAL:
|
||||
// Photo decoding may not have been finished yet.
|
||||
@ -485,7 +486,7 @@ void SupervisedUserCreationScreen::OnGetSupervisedUsers(
|
||||
// Copy for passing to WebUI, contains only id, name and avatar URL.
|
||||
scoped_ptr<base::ListValue> ui_users(new base::ListValue());
|
||||
SupervisedUserManager* supervised_user_manager =
|
||||
UserManager::Get()->GetSupervisedUserManager();
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager();
|
||||
|
||||
// Stored copy, contains all necessary information.
|
||||
existing_users_.reset(new base::DictionaryValue());
|
||||
|
@ -15,10 +15,11 @@
|
||||
#include "chrome/browser/chromeos/login/supervised/supervised_user_constants.h"
|
||||
#include "chrome/browser/chromeos/login/supervised/supervised_user_creation_screen.h"
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/wizard_controller.h"
|
||||
#include "chromeos/login/auth/key.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
|
||||
using content::BrowserThread;
|
||||
@ -69,10 +70,10 @@ void SupervisedUserLoginFlow::ConfigureSync(const std::string& token) {
|
||||
|
||||
// TODO(antrim): add error handling (no token loaded).
|
||||
// See also: http://crbug.com/312751
|
||||
UserManager::Get()->GetSupervisedUserManager()->ConfigureSyncWithToken(
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->ConfigureSyncWithToken(
|
||||
profile_, token);
|
||||
SupervisedUserAuthentication* auth =
|
||||
UserManager::Get()->GetSupervisedUserManager()->GetAuthentication();
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->GetAuthentication();
|
||||
|
||||
if (auth->HasScheduledPasswordUpdate(user_id())) {
|
||||
auth->LoadPasswordUpdateData(
|
||||
@ -95,7 +96,7 @@ void SupervisedUserLoginFlow::OnPasswordChangeDataLoaded(
|
||||
const base::DictionaryValue* password_data) {
|
||||
// Edge case, when manager has signed in and already updated the password.
|
||||
SupervisedUserAuthentication* auth =
|
||||
UserManager::Get()->GetSupervisedUserManager()->GetAuthentication();
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->GetAuthentication();
|
||||
if (!auth->NeedPasswordChange(user_id(), password_data)) {
|
||||
VLOG(1) << "Password already changed for " << user_id();
|
||||
auth->ClearScheduledPasswordUpdate(user_id());
|
||||
@ -179,7 +180,7 @@ void SupervisedUserLoginFlow::OnNewKeyAdded(
|
||||
scoped_ptr<base::DictionaryValue> password_data) {
|
||||
VLOG(1) << "New key added";
|
||||
SupervisedUserAuthentication* auth =
|
||||
UserManager::Get()->GetSupervisedUserManager()->GetAuthentication();
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->GetAuthentication();
|
||||
auth->StorePasswordData(user_id(), *password_data.get());
|
||||
auth->MarkKeyIncomplete(user_id(), true /* incomplete */);
|
||||
authenticator_->RemoveKey(
|
||||
@ -224,7 +225,7 @@ void SupervisedUserLoginFlow::OnPasswordUpdated(
|
||||
VLOG(1) << "Updated password for supervised user";
|
||||
|
||||
SupervisedUserAuthentication* auth =
|
||||
UserManager::Get()->GetSupervisedUserManager()->GetAuthentication();
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->GetAuthentication();
|
||||
|
||||
// Incomplete state is not there in password_data, carry it from old state.
|
||||
bool was_incomplete = auth->HasIncompleteKey(user_id());
|
||||
@ -248,11 +249,10 @@ void SupervisedUserLoginFlow::Finish() {
|
||||
void SupervisedUserLoginFlow::LaunchExtraSteps(
|
||||
Profile* profile) {
|
||||
profile_ = profile;
|
||||
UserManager::Get()->GetSupervisedUserManager()->LoadSupervisedUserToken(
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->LoadSupervisedUserToken(
|
||||
profile,
|
||||
base::Bind(
|
||||
&SupervisedUserLoginFlow::OnSyncSetupDataLoaded,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
base::Bind(&SupervisedUserLoginFlow::OnSyncSetupDataLoaded,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
}
|
||||
|
||||
} // namespace chromeos
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "chrome/browser/chromeos/login/supervised/supervised_user_test_base.h"
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
|
||||
#include "chrome/browser/chromeos/login/ui/webui_login_view.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
|
||||
#include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h"
|
||||
#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
|
||||
@ -78,9 +79,10 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest,
|
||||
DISABLED_PRE_PasswordChangeFromUserTest) {
|
||||
SigninAsSupervisedUser(true, 0, kTestSupervisedUserDisplayName);
|
||||
|
||||
const user_manager::User* user = UserManager::Get()->GetUsers().at(0);
|
||||
const user_manager::User* user =
|
||||
user_manager::UserManager::Get()->GetUsers().at(0);
|
||||
std::string sync_id =
|
||||
UserManager::Get()->GetSupervisedUserManager()->GetUserSyncId(
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->GetUserSyncId(
|
||||
user->email());
|
||||
base::DictionaryValue password;
|
||||
password.SetIntegerWithoutPathExpansion(
|
||||
@ -124,14 +126,14 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest,
|
||||
IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest,
|
||||
DISABLED_PRE_PasswordChangeFromManagerTest) {
|
||||
const user_manager::User* supervised_user =
|
||||
UserManager::Get()->GetUsers().at(0);
|
||||
user_manager::UserManager::Get()->GetUsers().at(0);
|
||||
|
||||
SigninAsManager(1);
|
||||
|
||||
EXPECT_CALL(*mock_homedir_methods_, AddKeyEx(_, _, _, _, _)).Times(1);
|
||||
|
||||
std::string sync_id =
|
||||
UserManager::Get()->GetSupervisedUserManager()->GetUserSyncId(
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->GetUserSyncId(
|
||||
supervised_user->email());
|
||||
|
||||
::sync_pb::ManagedUserSpecifics managed_user_proto;
|
||||
@ -190,9 +192,10 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest,
|
||||
DISABLED_PRE_PRE_PasswordChangeUserAndManagerTest) {
|
||||
SigninAsSupervisedUser(true, 0, kTestSupervisedUserDisplayName);
|
||||
|
||||
const user_manager::User* user = UserManager::Get()->GetUsers().at(0);
|
||||
const user_manager::User* user =
|
||||
user_manager::UserManager::Get()->GetUsers().at(0);
|
||||
std::string sync_id =
|
||||
UserManager::Get()->GetSupervisedUserManager()->GetUserSyncId(
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->GetUserSyncId(
|
||||
user->email());
|
||||
base::DictionaryValue password;
|
||||
password.SetIntegerWithoutPathExpansion(
|
||||
@ -213,14 +216,14 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest,
|
||||
IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest,
|
||||
DISABLED_PRE_PasswordChangeUserAndManagerTest) {
|
||||
const user_manager::User* supervised_user =
|
||||
UserManager::Get()->GetUsers().at(0);
|
||||
user_manager::UserManager::Get()->GetUsers().at(0);
|
||||
|
||||
SigninAsManager(1);
|
||||
|
||||
EXPECT_CALL(*mock_homedir_methods_, AddKeyEx(_, _, _, _, _)).Times(1);
|
||||
|
||||
std::string sync_id =
|
||||
UserManager::Get()->GetSupervisedUserManager()->GetUserSyncId(
|
||||
ChromeUserManager::Get()->GetSupervisedUserManager()->GetUserSyncId(
|
||||
supervised_user->email());
|
||||
|
||||
::sync_pb::ManagedUserSpecifics managed_user_proto;
|
||||
|
@ -300,7 +300,7 @@ void SupervisedUserTestBase::StartFlowLoginAsManager() {
|
||||
login_observer.Wait();
|
||||
|
||||
// OAuth token is valid.
|
||||
UserManager::Get()->SaveUserOAuthStatus(
|
||||
user_manager::UserManager::Get()->SaveUserOAuthStatus(
|
||||
kTestManager, user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
@ -357,11 +357,11 @@ void SupervisedUserTestBase::SigninAsSupervisedUser(
|
||||
EXPECT_CALL(*mock_homedir_methods_, MountEx(_, _, _, _)).Times(1);
|
||||
|
||||
// Log in as supervised user, make sure that everything works.
|
||||
ASSERT_EQ(3UL, UserManager::Get()->GetUsers().size());
|
||||
ASSERT_EQ(3UL, user_manager::UserManager::Get()->GetUsers().size());
|
||||
|
||||
// Created supervised user have to be first in a list.
|
||||
const user_manager::User* user =
|
||||
UserManager::Get()->GetUsers().at(user_index);
|
||||
user_manager::UserManager::Get()->GetUsers().at(user_index);
|
||||
ASSERT_EQ(base::UTF8ToUTF16(expected_display_name), user->display_name());
|
||||
LoginUser(user->email());
|
||||
if (check_homedir_calls)
|
||||
@ -377,11 +377,11 @@ void SupervisedUserTestBase::SigninAsSupervisedUser(
|
||||
|
||||
void SupervisedUserTestBase::SigninAsManager(int user_index) {
|
||||
// Log in as supervised user, make sure that everything works.
|
||||
ASSERT_EQ(3UL, UserManager::Get()->GetUsers().size());
|
||||
ASSERT_EQ(3UL, user_manager::UserManager::Get()->GetUsers().size());
|
||||
|
||||
// Created supervised user have to be first in a list.
|
||||
const user_manager::User* user =
|
||||
UserManager::Get()->GetUsers().at(user_index);
|
||||
user_manager::UserManager::Get()->GetUsers().at(user_index);
|
||||
LoginUser(user->email());
|
||||
Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user);
|
||||
shared_settings_adapter_.reset(
|
||||
@ -394,11 +394,12 @@ void SupervisedUserTestBase::RemoveSupervisedUser(
|
||||
int user_index,
|
||||
const std::string& expected_display_name) {
|
||||
// Remove supervised user.
|
||||
ASSERT_EQ(original_user_count, UserManager::Get()->GetUsers().size());
|
||||
ASSERT_EQ(original_user_count,
|
||||
user_manager::UserManager::Get()->GetUsers().size());
|
||||
|
||||
// Created supervised user have to be first in a list.
|
||||
const user_manager::User* user =
|
||||
UserManager::Get()->GetUsers().at(user_index);
|
||||
user_manager::UserManager::Get()->GetUsers().at(user_index);
|
||||
ASSERT_EQ(base::UTF8ToUTF16(expected_display_name), user->display_name());
|
||||
|
||||
// Open pod menu.
|
||||
@ -429,7 +430,8 @@ void SupervisedUserTestBase::RemoveSupervisedUser(
|
||||
user_index));
|
||||
|
||||
// Make sure there is no supervised user in list.
|
||||
ASSERT_EQ(original_user_count - 1, UserManager::Get()->GetUsers().size());
|
||||
ASSERT_EQ(original_user_count - 1,
|
||||
user_manager::UserManager::Get()->GetUsers().size());
|
||||
}
|
||||
|
||||
} // namespace chromeos
|
||||
|
@ -12,9 +12,9 @@
|
||||
#include "base/strings/string16.h"
|
||||
#include "chrome/browser/chromeos/login/help_app_launcher.h"
|
||||
#include "chrome/browser/chromeos/login/signin_specifics.h"
|
||||
#include "chrome/browser/chromeos/login/users/remove_user_delegate.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "components/user_manager/remove_user_delegate.h"
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
#include "ui/gfx/native_widget_types.h"
|
||||
#include "ui/gfx/rect.h"
|
||||
@ -25,7 +25,7 @@ class UserContext;
|
||||
|
||||
// TODO(nkostylev): Extract interface, create a BaseLoginDisplay class.
|
||||
// An abstract class that defines login UI implementation.
|
||||
class LoginDisplay : public RemoveUserDelegate {
|
||||
class LoginDisplay : public user_manager::RemoveUserDelegate {
|
||||
public:
|
||||
// Sign in error IDs that require detailed error screen and not just
|
||||
// a simple error bubble.
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include "chrome/browser/chromeos/login/ui/oobe_display.h"
|
||||
#include "chrome/browser/chromeos/login/ui/webui_login_display.h"
|
||||
#include "chrome/browser/chromeos/login/ui/webui_login_view.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/wizard_controller.h"
|
||||
#include "chrome/browser/chromeos/mobile_config.h"
|
||||
#include "chrome/browser/chromeos/net/delay_network_call.h"
|
||||
@ -70,6 +69,7 @@
|
||||
#include "chromeos/login/login_state.h"
|
||||
#include "chromeos/settings/timezone_settings.h"
|
||||
#include "components/session_manager/core/session_manager.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/browser/notification_types.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
@ -408,7 +408,7 @@ LoginDisplayHostImpl::~LoginDisplayHostImpl() {
|
||||
|
||||
default_host_ = NULL;
|
||||
// TODO(tengs): This should be refactored. See crbug.com/314934.
|
||||
if (UserManager::Get()->IsCurrentUserNew()) {
|
||||
if (user_manager::UserManager::Get()->IsCurrentUserNew()) {
|
||||
// DriveOptInController will delete itself when finished.
|
||||
(new DriveFirstRunController(
|
||||
ProfileManager::GetActiveUserProfile()))->EnableOfflineMode();
|
||||
@ -568,7 +568,7 @@ void LoginDisplayHostImpl::StartUserAdding(
|
||||
SetOobeProgressBarVisible(oobe_progress_bar_visible_ = false);
|
||||
SetStatusAreaVisible(true);
|
||||
sign_in_controller_->Init(
|
||||
chromeos::UserManager::Get()->GetUsersAdmittedForMultiProfile());
|
||||
user_manager::UserManager::Get()->GetUsersAdmittedForMultiProfile());
|
||||
CHECK(webui_login_display_);
|
||||
GetOobeUI()->ShowSigninScreen(LoginScreenContext(),
|
||||
webui_login_display_,
|
||||
@ -605,7 +605,7 @@ void LoginDisplayHostImpl::StartSignInScreen(
|
||||
|
||||
DVLOG(1) << "Starting sign in screen";
|
||||
const user_manager::UserList& users =
|
||||
chromeos::UserManager::Get()->GetUsers();
|
||||
user_manager::UserManager::Get()->GetUsers();
|
||||
|
||||
// Fix for users who updated device and thus never passed register screen.
|
||||
// If we already have users, we assume that it is not a second part of
|
||||
@ -777,7 +777,7 @@ void LoginDisplayHostImpl::Observe(
|
||||
chrome::NOTIFICATION_BROWSER_OPENED,
|
||||
content::NotificationService::AllSources());
|
||||
} else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED &&
|
||||
chromeos::UserManager::Get()->IsCurrentUserNew()) {
|
||||
user_manager::UserManager::Get()->IsCurrentUserNew()) {
|
||||
// For new user, move desktop to locker container so that windows created
|
||||
// during the user image picker step are below it.
|
||||
ash::Shell::GetInstance()->
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
|
||||
#include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
|
||||
#include "components/session_manager/core/session_manager.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "ui/gfx/rect.h"
|
||||
#include "ui/gfx/size.h"
|
||||
|
||||
@ -64,9 +65,9 @@ void UserAddingScreenImpl::Cancel() {
|
||||
display_host_->Finalize();
|
||||
|
||||
// Reset wallpaper if cancel adding user from multiple user sign in page.
|
||||
if (UserManager::Get()->IsUserLoggedIn()) {
|
||||
if (user_manager::UserManager::Get()->IsUserLoggedIn()) {
|
||||
WallpaperManager::Get()->SetUserWallpaperDelayed(
|
||||
UserManager::Get()->GetActiveUser()->email());
|
||||
user_manager::UserManager::Get()->GetActiveUser()->email());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,10 +14,10 @@
|
||||
#include "chrome/browser/chromeos/login/ui/user_adding_screen.h"
|
||||
#include "chrome/browser/chromeos/login/ui/webui_login_view.h"
|
||||
#include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chrome/test/base/in_process_browser_test.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
@ -92,15 +92,15 @@ IN_PROC_BROWSER_TEST_F(UserAddingScreenTest, PRE_CancelAdding) {
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(UserAddingScreenTest, CancelAdding) {
|
||||
EXPECT_CALL(login_utils(), DoBrowserLaunch(_, _)).Times(1);
|
||||
EXPECT_EQ(3u, UserManager::Get()->GetUsers().size());
|
||||
EXPECT_EQ(0u, UserManager::Get()->GetLoggedInUsers().size());
|
||||
EXPECT_EQ(3u, user_manager::UserManager::Get()->GetUsers().size());
|
||||
EXPECT_EQ(0u, user_manager::UserManager::Get()->GetLoggedInUsers().size());
|
||||
|
||||
EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_LOGIN_PRIMARY,
|
||||
ash::Shell::GetInstance()->session_state_delegate()->
|
||||
GetSessionState());
|
||||
|
||||
LoginUser(kTestUsers[0]);
|
||||
EXPECT_EQ(1u, UserManager::Get()->GetLoggedInUsers().size());
|
||||
EXPECT_EQ(1u, user_manager::UserManager::Get()->GetLoggedInUsers().size());
|
||||
EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_ACTIVE,
|
||||
ash::Shell::GetInstance()->session_state_delegate()->
|
||||
GetSessionState());
|
||||
@ -120,8 +120,9 @@ IN_PROC_BROWSER_TEST_F(UserAddingScreenTest, CancelAdding) {
|
||||
GetSessionState());
|
||||
|
||||
EXPECT_TRUE(LoginDisplayHostImpl::default_host() == NULL);
|
||||
EXPECT_EQ(1u, UserManager::Get()->GetLoggedInUsers().size());
|
||||
EXPECT_EQ(kTestUsers[0], UserManager::Get()->GetActiveUser()->email());
|
||||
EXPECT_EQ(1u, user_manager::UserManager::Get()->GetLoggedInUsers().size());
|
||||
EXPECT_EQ(kTestUsers[0],
|
||||
user_manager::UserManager::Get()->GetActiveUser()->email());
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(UserAddingScreenTest, PRE_AddingSeveralUsers) {
|
||||
@ -141,7 +142,7 @@ IN_PROC_BROWSER_TEST_F(UserAddingScreenTest, AddingSeveralUsers) {
|
||||
ash::Shell::GetInstance()->session_state_delegate()->
|
||||
GetSessionState());
|
||||
|
||||
UserManager* user_manager = UserManager::Get();
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
|
||||
for (int i = 1; i < 3; ++i) {
|
||||
UserAddingScreen::Get()->Start();
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "chromeos/ime/ime_keyboard.h"
|
||||
#include "chromeos/ime/input_method_manager.h"
|
||||
#include "chromeos/login/user_names.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
#include "ui/wm/core/user_activity_detector.h"
|
||||
@ -122,7 +123,7 @@ void WebUILoginDisplay::SetUIEnabled(bool is_enabled) {
|
||||
// Allow this call only before user sign in or at lock screen.
|
||||
// If this call is made after new user signs in but login screen is still
|
||||
// around that would trigger a sign in extension refresh.
|
||||
if (is_enabled && (!UserManager::Get()->IsUserLoggedIn() ||
|
||||
if (is_enabled && (!user_manager::UserManager::Get()->IsUserLoggedIn() ||
|
||||
ScreenLocker::default_screen_locker())) {
|
||||
ClearAndEnablePassword();
|
||||
}
|
||||
@ -277,7 +278,7 @@ void WebUILoginDisplay::OnSigninScreenReady() {
|
||||
}
|
||||
|
||||
void WebUILoginDisplay::RemoveUser(const std::string& username) {
|
||||
UserManager::Get()->RemoveUser(username, this);
|
||||
user_manager::UserManager::Get()->RemoveUser(username, this);
|
||||
}
|
||||
|
||||
void WebUILoginDisplay::ResyncUserData() {
|
||||
|
@ -5,14 +5,14 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "chrome/browser/chromeos/login/user_flow.h"
|
||||
#include "chrome/browser/chromeos/login/users/user_manager.h"
|
||||
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
||||
|
||||
namespace chromeos {
|
||||
|
||||
namespace {
|
||||
|
||||
void UnregisterFlow(const std::string& user_id) {
|
||||
UserManager::Get()->ResetUserFlow(user_id);
|
||||
ChromeUserManager::Get()->ResetUserFlow(user_id);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user