diff options
Diffstat (limited to 'chrome/browser')
11 files changed, 23 insertions, 59 deletions
diff --git a/chrome/browser/chromeos/login/users/user.h b/chrome/browser/chromeos/login/users/user.h index 58b0cd3..5289962 100644 --- a/chrome/browser/chromeos/login/users/user.h +++ b/chrome/browser/chromeos/login/users/user.h @@ -8,10 +8,10 @@ #include <string> #include <vector> -#include "ash/session/user_info.h" #include "base/basictypes.h" #include "base/strings/string16.h" #include "components/user_manager/user_image/user_image.h" +#include "components/user_manager/user_info.h" #include "components/user_manager/user_type.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/image/image_skia.h" @@ -26,7 +26,7 @@ extern const int kDefaultImagesCount; // returned by |displayed_email()|. // Displayed emails are for use in UI only, anywhere else users must be referred // to by |email()|. -class User : public ash::UserInfo { +class User : public user_manager::UserInfo { public: // User OAuth token status according to the last check. // Please note that enum values 1 and 2 were used for OAuth1 status and are @@ -63,7 +63,7 @@ class User : public ash::UserInfo { // The displayed user name. base::string16 display_name() const { return display_name_; } - // ash::UserInfo + // user_manager::UserInfo virtual std::string GetEmail() const OVERRIDE; virtual base::string16 GetDisplayName() const OVERRIDE; virtual base::string16 GetGivenName() const OVERRIDE; diff --git a/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc b/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc index 09a52f2..a10e61b 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc @@ -87,7 +87,8 @@ scoped_ptr<ui::MenuModel> CreateMultiUserContextMenu(aura::Window* window) { new chromeos::MultiUserContextMenuChromeos(window); model.reset(menu); for (int user_index = 1; user_index < logged_in_users; ++user_index) { - const ash::UserInfo* user_info = delegate->GetUserInfo(user_index); + const user_manager::UserInfo* user_info = + delegate->GetUserInfo(user_index); menu->AddItem(user_index == 1 ? IDC_VISIT_DESKTOP_OF_LRU_USER_2 : IDC_VISIT_DESKTOP_OF_LRU_USER_3, l10n_util::GetStringFUTF16( diff --git a/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos_unittest.cc index 88bf046..79800ef 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos_unittest.cc @@ -3,7 +3,6 @@ // found in the LICENSE file. #include "ash/session/session_state_delegate.h" -#include "ash/session/user_info.h" #include "ash/shell.h" #include "ash/system/system_notifier.h" #include "ash/test/ash_test_base.h" @@ -13,6 +12,7 @@ #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile_manager.h" +#include "components/user_manager/user_info.h" #include "ui/message_center/message_center.h" #include "ui/message_center/notification.h" diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc index 93b2af1..a1e3362 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc @@ -11,10 +11,10 @@ #include "ash/ash_switches.h" #include "ash/multi_profile_uma.h" #include "ash/session/session_state_delegate.h" -#include "ash/session/user_info.h" #include "ash/shell.h" #include "ash/shell_delegate.h" #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" +#include "components/user_manager/user_info.h" #endif namespace { diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc index f425e0bb..29da872 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/session/user_info.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" @@ -19,6 +18,7 @@ #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" #include "chrome/browser/ui/ash/multi_user/user_switch_animator_chromeos.h" #include "chrome/test/base/testing_profile.h" +#include "components/user_manager/user_info.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/ui_base_types.h" diff --git a/chrome/browser/ui/ash/session_state_delegate_chromeos.cc b/chrome/browser/ui/ash/session_state_delegate_chromeos.cc index ad073e6..27e57f4 100644 --- a/chrome/browser/ui/ash/session_state_delegate_chromeos.cc +++ b/chrome/browser/ui/ash/session_state_delegate_chromeos.cc @@ -133,13 +133,13 @@ SessionStateDelegateChromeos::GetSessionState() const { return session_state_; } -const ash::UserInfo* SessionStateDelegateChromeos::GetUserInfo( +const user_manager::UserInfo* SessionStateDelegateChromeos::GetUserInfo( ash::MultiProfileIndex index) const { DCHECK_LT(index, NumberOfLoggedInUsers()); return chromeos::UserManager::Get()->GetLRULoggedInUsers()[index]; } -const ash::UserInfo* SessionStateDelegateChromeos::GetUserInfo( +const user_manager::UserInfo* SessionStateDelegateChromeos::GetUserInfo( content::BrowserContext* context) const { DCHECK(context); return chromeos::ProfileHelper::Get()->GetUserByProfile( diff --git a/chrome/browser/ui/ash/session_state_delegate_chromeos.h b/chrome/browser/ui/ash/session_state_delegate_chromeos.h index 104afe8..af0b055 100644 --- a/chrome/browser/ui/ash/session_state_delegate_chromeos.h +++ b/chrome/browser/ui/ash/session_state_delegate_chromeos.h @@ -41,9 +41,9 @@ class SessionStateDelegateChromeos virtual void UnlockScreen() OVERRIDE; virtual bool IsUserSessionBlocked() const OVERRIDE; virtual SessionState GetSessionState() const OVERRIDE; - virtual const ash::UserInfo* GetUserInfo( + virtual const user_manager::UserInfo* GetUserInfo( ash::MultiProfileIndex index) const OVERRIDE; - virtual const ash::UserInfo* GetUserInfo( + virtual const user_manager::UserInfo* GetUserInfo( content::BrowserContext* context) const OVERRIDE; virtual bool ShouldShowAvatar(aura::Window* window) const OVERRIDE; virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; diff --git a/chrome/browser/ui/ash/session_state_delegate_views.cc b/chrome/browser/ui/ash/session_state_delegate_views.cc index 675a9bf..9622319 100644 --- a/chrome/browser/ui/ash/session_state_delegate_views.cc +++ b/chrome/browser/ui/ash/session_state_delegate_views.cc @@ -4,51 +4,12 @@ #include "chrome/browser/ui/ash/session_state_delegate_views.h" -#include "ash/session/user_info.h" #include "base/logging.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" +#include "components/user_manager/empty_user_info.h" #include "ui/gfx/image/image_skia.h" -namespace { - -class EmptyUserInfo : public ash::UserInfo { - public: - EmptyUserInfo() {} - virtual ~EmptyUserInfo() {} - - // ash::UserInfo: - virtual base::string16 GetDisplayName() const OVERRIDE { - NOTIMPLEMENTED(); - return base::UTF8ToUTF16(std::string()); - } - virtual base::string16 GetGivenName() const OVERRIDE { - NOTIMPLEMENTED(); - return base::UTF8ToUTF16(std::string()); - } - virtual std::string GetEmail() const OVERRIDE { - NOTIMPLEMENTED(); - return std::string(); - } - virtual std::string GetUserID() const OVERRIDE { - NOTIMPLEMENTED(); - return std::string(); - } - - virtual const gfx::ImageSkia& GetImage() const OVERRIDE { - NOTIMPLEMENTED(); - // To make the compiler happy. - return null_image_; - } - - private: - const gfx::ImageSkia null_image_; - - DISALLOW_COPY_AND_ASSIGN(EmptyUserInfo); -}; - -} // namespace - SessionStateDelegate::SessionStateDelegate() { } @@ -106,14 +67,15 @@ ash::SessionStateDelegate::SessionState SessionStateDelegate::GetSessionState() return SESSION_STATE_ACTIVE; } -const ash::UserInfo* SessionStateDelegate::GetUserInfo( +const user_manager::UserInfo* SessionStateDelegate::GetUserInfo( ash::MultiProfileIndex index) const { return GetUserInfo(static_cast<content::BrowserContext*>(NULL)); } -const ash::UserInfo* SessionStateDelegate::GetUserInfo( +const user_manager::UserInfo* SessionStateDelegate::GetUserInfo( content::BrowserContext* context) const { - static const ash::UserInfo* kUserInfo = new EmptyUserInfo(); + static const user_manager::UserInfo* kUserInfo = + new user_manager::EmptyUserInfo(); return kUserInfo; } diff --git a/chrome/browser/ui/ash/session_state_delegate_views.h b/chrome/browser/ui/ash/session_state_delegate_views.h index 3b32b29..14e005e 100644 --- a/chrome/browser/ui/ash/session_state_delegate_views.h +++ b/chrome/browser/ui/ash/session_state_delegate_views.h @@ -35,9 +35,9 @@ class SessionStateDelegate : public ash::SessionStateDelegate { virtual void UnlockScreen() OVERRIDE; virtual bool IsUserSessionBlocked() const OVERRIDE; virtual SessionState GetSessionState() const OVERRIDE; - virtual const ash::UserInfo* GetUserInfo( + virtual const user_manager::UserInfo* GetUserInfo( ash::MultiProfileIndex index) const OVERRIDE; - virtual const ash::UserInfo* GetUserInfo( + virtual const user_manager::UserInfo* GetUserInfo( content::BrowserContext* context) const OVERRIDE; virtual bool ShouldShowAvatar(aura::Window* window) const OVERRIDE; virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; diff --git a/chrome/browser/ui/views/DEPS b/chrome/browser/ui/views/DEPS index 92c7377..8b91a12 100644 --- a/chrome/browser/ui/views/DEPS +++ b/chrome/browser/ui/views/DEPS @@ -1,4 +1,5 @@ include_rules = [ "-chrome/browser/ui/libgtk2ui", - "+chrome/browser/ui/views" + "+chrome/browser/ui/views", + "+components/user_manager" ] diff --git a/chrome/browser/ui/views/frame/system_menu_model_builder.cc b/chrome/browser/ui/views/frame/system_menu_model_builder.cc index 44dacd8..9848722 100644 --- a/chrome/browser/ui/views/frame/system_menu_model_builder.cc +++ b/chrome/browser/ui/views/frame/system_menu_model_builder.cc @@ -17,11 +17,11 @@ #if defined(OS_CHROMEOS) #include "ash/session/session_state_delegate.h" -#include "ash/session/user_info.h" #include "ash/shell.h" #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" #include "chrome/browser/ui/browser_window.h" +#include "components/user_manager/user_info.h" #include "ui/base/l10n/l10n_util.h" #endif @@ -152,7 +152,7 @@ void SystemMenuModelBuilder::AppendTeleportMenu(ui::SimpleMenuModel* model) { model->AddSeparator(ui::NORMAL_SEPARATOR); DCHECK(logged_in_users <= 3); for (int user_index = 1; user_index < logged_in_users; ++user_index) { - const ash::UserInfo* user_info = delegate->GetUserInfo(user_index); + const user_manager::UserInfo* user_info = delegate->GetUserInfo(user_index); model->AddItem( user_index == 1 ? IDC_VISIT_DESKTOP_OF_LRU_USER_2 : IDC_VISIT_DESKTOP_OF_LRU_USER_3, |