From d66eac44cda6b48f70bf6ef06adc72c8638b39bf Mon Sep 17 00:00:00 2001 From: "nkostylev@chromium.org" Date: Mon, 14 Jul 2014 23:48:30 +0000 Subject: Move UserInfo to user_manager. Since user_manager::UserInfo is used on non-chromeos ash implementation, defined part of user_manager component that is included on cross-platform ash. BUG=387614 Review URL: https://codereview.chromium.org/379803004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283087 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/shell/shell_delegate_impl.cc | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) (limited to 'ash/shell') diff --git a/ash/shell/shell_delegate_impl.cc b/ash/shell/shell_delegate_impl.cc index 289d769..6261e1e 100644 --- a/ash/shell/shell_delegate_impl.cc +++ b/ash/shell/shell_delegate_impl.cc @@ -11,7 +11,6 @@ #include "ash/media_delegate.h" #include "ash/new_window_delegate.h" #include "ash/session/session_state_delegate.h" -#include "ash/session/user_info.h" #include "ash/shell/context_menu.h" #include "ash/shell/example_factory.h" #include "ash/shell/keyboard_controller_proxy_stub.h" @@ -22,6 +21,7 @@ #include "ash/wm/window_state.h" #include "base/message_loop/message_loop.h" #include "base/strings/utf_string_conversions.h" +#include "components/user_manager/user_info_impl.h" #include "ui/aura/window.h" #include "ui/wm/core/input_method_event_filter.h" @@ -71,36 +71,10 @@ class MediaDelegateImpl : public MediaDelegate { DISALLOW_COPY_AND_ASSIGN(MediaDelegateImpl); }; -class UserInfoImpl : public UserInfo { - public: - UserInfoImpl() {} - virtual ~UserInfoImpl() {} - - // UserInfo: - virtual base::string16 GetDisplayName() const OVERRIDE { - return base::UTF8ToUTF16("stub-user"); - } - virtual base::string16 GetGivenName() const OVERRIDE { - return base::UTF8ToUTF16("Stub"); - } - virtual std::string GetEmail() const OVERRIDE { - return "stub-user@domain.com"; - } - virtual std::string GetUserID() const OVERRIDE { return GetEmail(); } - virtual const gfx::ImageSkia& GetImage() const OVERRIDE { - return user_image_; - } - - private: - gfx::ImageSkia user_image_; - - DISALLOW_COPY_AND_ASSIGN(UserInfoImpl); -}; - class SessionStateDelegateImpl : public SessionStateDelegate { public: SessionStateDelegateImpl() - : screen_locked_(false), user_info_(new UserInfoImpl()) {} + : screen_locked_(false), user_info_(new user_manager::UserInfoImpl()) {} virtual ~SessionStateDelegateImpl() {} @@ -141,10 +115,11 @@ class SessionStateDelegateImpl : public SessionStateDelegate { return IsActiveUserSessionStarted() ? SESSION_STATE_ACTIVE : SESSION_STATE_LOGIN_PRIMARY; } - virtual const UserInfo* GetUserInfo(MultiProfileIndex index) const OVERRIDE { + virtual const user_manager::UserInfo* GetUserInfo( + MultiProfileIndex index) const OVERRIDE { return user_info_.get(); } - virtual const UserInfo* GetUserInfo( + virtual const user_manager::UserInfo* GetUserInfo( content::BrowserContext* context) const OVERRIDE { return user_info_.get(); } @@ -162,7 +137,7 @@ class SessionStateDelegateImpl : public SessionStateDelegate { bool screen_locked_; // A pseudo user info. - scoped_ptr user_info_; + scoped_ptr user_info_; DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateImpl); }; -- cgit v1.1