diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-21 12:48:44 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-21 12:48:44 +0000 |
commit | 5a05528be0f07d8a169897e27dbef996f9e13f65 (patch) | |
tree | f732cdc208d5c8cb994c614199dc27031194343f /ash/test | |
parent | 18c83cc15087788e314580d2fd20aff907ba1589 (diff) | |
download | chromium_src-5a05528be0f07d8a169897e27dbef996f9e13f65.zip chromium_src-5a05528be0f07d8a169897e27dbef996f9e13f65.tar.gz chromium_src-5a05528be0f07d8a169897e27dbef996f9e13f65.tar.bz2 |
Show avatar icon on V2 app's frame
BUG=305071
TEST=CustomFrameViewAsh.AvatarIcon + manual test.
TBR=sky@chromium.org
Review URL: https://codereview.chromium.org/200483004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test')
-rw-r--r-- | ash/test/test_session_state_delegate.cc | 15 | ||||
-rw-r--r-- | ash/test/test_session_state_delegate.h | 7 |
2 files changed, 19 insertions, 3 deletions
diff --git a/ash/test/test_session_state_delegate.cc b/ash/test/test_session_state_delegate.cc index 722981f..491408e 100644 --- a/ash/test/test_session_state_delegate.cc +++ b/ash/test/test_session_state_delegate.cc @@ -46,6 +46,12 @@ TestSessionStateDelegate::GetBrowserContextByIndex( return NULL; } +content::BrowserContext* +TestSessionStateDelegate::GetBrowserContextForWindow( + aura::Window* window) { + return NULL; +} + int TestSessionStateDelegate::GetMaximumNumberOfLoggedInUsers() const { return 3; } @@ -118,6 +124,11 @@ void TestSessionStateDelegate::SetUserAddingScreenRunning( user_adding_screen_running_ = user_adding_screen_running; } +void TestSessionStateDelegate::SetUserImage( + const gfx::ImageSkia& user_image) { + user_image_ = user_image; +} + const base::string16 TestSessionStateDelegate::GetUserDisplayName( MultiProfileIndex index) const { return base::UTF8ToUTF16("Über tray Über tray Über tray Über tray"); @@ -140,11 +151,11 @@ const std::string TestSessionStateDelegate::GetUserID( const gfx::ImageSkia& TestSessionStateDelegate::GetUserImage( content::BrowserContext* context) const { - return null_image_; + return user_image_; } bool TestSessionStateDelegate::ShouldShowAvatar(aura::Window* window) { - return false; + return !user_image_.isNull(); } void TestSessionStateDelegate::SwitchActiveUser(const std::string& user_id) { diff --git a/ash/test/test_session_state_delegate.h b/ash/test/test_session_state_delegate.h index 21c34f6..2cc95e5 100644 --- a/ash/test/test_session_state_delegate.h +++ b/ash/test/test_session_state_delegate.h @@ -24,6 +24,8 @@ class TestSessionStateDelegate : public SessionStateDelegate { // SessionStateDelegate: virtual content::BrowserContext* GetBrowserContextByIndex( MultiProfileIndex index) OVERRIDE; + virtual content::BrowserContext* GetBrowserContextForWindow( + aura::Window* window) OVERRIDE; virtual int GetMaximumNumberOfLoggedInUsers() const OVERRIDE; virtual int NumberOfLoggedInUsers() const OVERRIDE; virtual bool IsActiveUserSessionStarted() const OVERRIDE; @@ -75,6 +77,9 @@ class TestSessionStateDelegate : public SessionStateDelegate { // running now. void SetUserAddingScreenRunning(bool user_adding_screen_running); + // Setting non NULL image enables avatar icon. + void SetUserImage(const gfx::ImageSkia& user_image); + private: // Whether a session is in progress and there is an active user. bool has_active_user_; @@ -104,7 +109,7 @@ class TestSessionStateDelegate : public SessionStateDelegate { std::string activated_user_; // A test user image. - gfx::ImageSkia null_image_; + gfx::ImageSkia user_image_; DISALLOW_COPY_AND_ASSIGN(TestSessionStateDelegate); }; |