summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-21 12:48:44 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-21 12:48:44 +0000
commit5a05528be0f07d8a169897e27dbef996f9e13f65 (patch)
treef732cdc208d5c8cb994c614199dc27031194343f
parent18c83cc15087788e314580d2fd20aff907ba1589 (diff)
downloadchromium_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
-rw-r--r--ash/frame/custom_frame_view_ash.cc52
-rw-r--r--ash/frame/custom_frame_view_ash.h4
-rw-r--r--ash/frame/custom_frame_view_ash_unittest.cc33
-rw-r--r--ash/frame/default_header_painter.cc13
-rw-r--r--ash/frame/default_header_painter.h4
-rw-r--r--ash/frame/header_painter_util.cc8
-rw-r--r--ash/frame/header_painter_util.h2
-rw-r--r--ash/session_state_delegate.h4
-rw-r--r--ash/session_state_delegate_stub.cc13
-rw-r--r--ash/session_state_delegate_stub.h4
-rw-r--r--ash/test/test_session_state_delegate.cc15
-rw-r--r--ash/test/test_session_state_delegate.h7
-rw-r--r--chrome/browser/ui/ash/session_state_delegate_chromeos.cc10
-rw-r--r--chrome/browser/ui/ash/session_state_delegate_chromeos.h2
-rw-r--r--chrome/browser/ui/ash/session_state_delegate_views.cc6
-rw-r--r--chrome/browser/ui/ash/session_state_delegate_views.h2
-rw-r--r--chrome/browser/ui/views/frame/browser_header_painter_ash.cc2
17 files changed, 165 insertions, 16 deletions
diff --git a/ash/frame/custom_frame_view_ash.cc b/ash/frame/custom_frame_view_ash.cc
index 96bcafb..f36303a 100644
--- a/ash/frame/custom_frame_view_ash.cc
+++ b/ash/frame/custom_frame_view_ash.cc
@@ -10,7 +10,10 @@
#include "ash/frame/caption_buttons/frame_maximize_button_observer.h"
#include "ash/frame/default_header_painter.h"
#include "ash/frame/frame_border_hit_test_controller.h"
+#include "ash/frame/frame_util.h"
#include "ash/frame/header_painter.h"
+#include "ash/session_state_delegate.h"
+#include "ash/shell.h"
#include "ash/wm/immersive_fullscreen_controller.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_state_delegate.h"
@@ -20,9 +23,11 @@
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/image/image.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/size.h"
+#include "ui/views/controls/image_view.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
@@ -142,6 +147,8 @@ class CustomFrameViewAsh::HeaderView
// Returns the view's minimum width.
int GetMinimumWidth() const;
+ void UpdateAvatarIcon();
+
// views::View overrides:
virtual void Layout() OVERRIDE;
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
@@ -150,6 +157,10 @@ class CustomFrameViewAsh::HeaderView
return caption_button_container_;
}
+ views::View* avatar_icon() const {
+ return avatar_icon_;
+ }
+
private:
// ImmersiveFullscreenController::Delegate overrides:
virtual void OnImmersiveRevealStarted() OVERRIDE;
@@ -167,6 +178,8 @@ class CustomFrameViewAsh::HeaderView
// Helper for painting the header.
scoped_ptr<DefaultHeaderPainter> header_painter_;
+ views::ImageView* avatar_icon_;
+
// View which contains the window caption buttons.
FrameCaptionButtonContainerView* caption_button_container_;
@@ -187,6 +200,7 @@ class CustomFrameViewAsh::HeaderView
CustomFrameViewAsh::HeaderView::HeaderView(views::Widget* frame)
: frame_(frame),
header_painter_(new ash::DefaultHeaderPainter),
+ avatar_icon_(NULL),
caption_button_container_(NULL),
maximize_bubble_(NULL),
fullscreen_visible_fraction_(0) {
@@ -205,6 +219,7 @@ CustomFrameViewAsh::HeaderView::HeaderView(views::Widget* frame)
frame_maximize_button->AddObserver(this);
header_painter_->Init(frame_, this, NULL, caption_button_container_);
+ UpdateAvatarIcon();
}
CustomFrameViewAsh::HeaderView::~HeaderView() {
@@ -238,6 +253,33 @@ int CustomFrameViewAsh::HeaderView::GetMinimumWidth() const {
return header_painter_->GetMinimumHeaderWidth();
}
+void CustomFrameViewAsh::HeaderView::UpdateAvatarIcon() {
+ SessionStateDelegate* delegate =
+ Shell::GetInstance()->session_state_delegate();
+ aura::Window* window = frame_->GetNativeView();
+ bool show = delegate->ShouldShowAvatar(window);
+ int icon_size = 0;
+ if (!show) {
+ if (!avatar_icon_)
+ return;
+ delete avatar_icon_;
+ avatar_icon_ = NULL;
+ } else {
+ gfx::ImageSkia image = GetAvatarImageForContext(
+ delegate->GetBrowserContextForWindow(window)).AsImageSkia();
+ DCHECK(!image.isNull());
+ DCHECK_EQ(image.width(), image.height());
+ if (!avatar_icon_) {
+ avatar_icon_ = new views::ImageView();
+ AddChildView(avatar_icon_);
+ }
+ avatar_icon_->SetImage(image);
+ icon_size = image.width();
+ }
+ header_painter_->UpdateWindowIcon(avatar_icon_, icon_size);
+ Layout();
+}
+
void CustomFrameViewAsh::HeaderView::Layout() {
header_painter_->LayoutHeader();
}
@@ -475,10 +517,20 @@ bool CustomFrameViewAsh::HitTestRect(const gfx::Rect& rect) const {
return false;
}
+void CustomFrameViewAsh::VisibilityChanged(views::View* starting_from,
+ bool is_visible) {
+ if (is_visible)
+ header_view_->UpdateAvatarIcon();
+}
+
views::View* CustomFrameViewAsh::GetHeaderView() {
return header_view_;
}
+const views::View* CustomFrameViewAsh::GetAvatarIconViewForTest() const {
+ return header_view_->avatar_icon();
+}
+
////////////////////////////////////////////////////////////////////////////////
// CustomFrameViewAsh, private:
diff --git a/ash/frame/custom_frame_view_ash.h b/ash/frame/custom_frame_view_ash.h
index 6fd9bdf..bfa6729 100644
--- a/ash/frame/custom_frame_view_ash.h
+++ b/ash/frame/custom_frame_view_ash.h
@@ -58,10 +58,14 @@ class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView {
virtual gfx::Size GetMaximumSize() OVERRIDE;
virtual void SchedulePaintInRect(const gfx::Rect& r) OVERRIDE;
virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE;
+ virtual void VisibilityChanged(views::View* starting_from,
+ bool is_visible) OVERRIDE;
// Get the view of the header.
views::View* GetHeaderView();
+ const views::View* GetAvatarIconViewForTest() const;
+
private:
class OverlayView;
friend class TestWidgetConstraintsDelegate;
diff --git a/ash/frame/custom_frame_view_ash_unittest.cc b/ash/frame/custom_frame_view_ash_unittest.cc
index eb0a543d3..68a85a8 100644
--- a/ash/frame/custom_frame_view_ash_unittest.cc
+++ b/ash/frame/custom_frame_view_ash_unittest.cc
@@ -4,7 +4,9 @@
#include "ash/frame/custom_frame_view_ash.h"
+#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
+#include "ash/test/test_session_state_delegate.h"
#include "base/memory/scoped_ptr.h"
#include "grit/ash_resources.h"
#include "ui/base/resource/resource_bundle.h"
@@ -97,6 +99,11 @@ class CustomFrameViewAshTest : public test::AshTestBase {
return widget.Pass();
}
+ test::TestSessionStateDelegate* GetTestSessionStateDelegate() {
+ return static_cast<ash::test::TestSessionStateDelegate*>(
+ Shell::GetInstance()->session_state_delegate());
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAshTest);
};
@@ -158,4 +165,30 @@ TEST_F(CustomFrameViewAshTest, MinimumAndMaximumSize) {
max_frame_size.height());
}
+// Verify that CustomFrameViewAsh updates the avatar icon based on the
+// state of the SessionStateDelegate after visibility change.
+TEST_F(CustomFrameViewAshTest, AvatarIcon) {
+ TestWidgetConstraintsDelegate* delegate = new TestWidgetConstraintsDelegate;
+ scoped_ptr<views::Widget> widget(CreateWidget(delegate));
+
+ CustomFrameViewAsh* custom_frame_view = delegate->custom_frame_view();
+ EXPECT_FALSE(custom_frame_view->GetAvatarIconViewForTest());
+
+ // Avatar image becomes available.
+ const gfx::ImageSkia user_image =
+ *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ IDR_AURA_UBER_TRAY_GUEST_ICON);
+ GetTestSessionStateDelegate()->SetUserImage(user_image);
+ widget->Hide();
+ widget->Show();
+ EXPECT_TRUE(custom_frame_view->GetAvatarIconViewForTest());
+
+ // Avatar image is gone; the ImageView for the avatar icon should be
+ // removed.
+ GetTestSessionStateDelegate()->SetUserImage(gfx::ImageSkia());
+ widget->Hide();
+ widget->Show();
+ EXPECT_FALSE(custom_frame_view->GetAvatarIconViewForTest());
+}
+
} // namespace ash
diff --git a/ash/frame/default_header_painter.cc b/ash/frame/default_header_painter.cc
index 80e2f53..946126f 100644
--- a/ash/frame/default_header_painter.cc
+++ b/ash/frame/default_header_painter.cc
@@ -75,6 +75,7 @@ DefaultHeaderPainter::DefaultHeaderPainter()
: frame_(NULL),
view_(NULL),
window_icon_(NULL),
+ window_icon_size_(HeaderPainterUtil::GetDefaultIconSize()),
caption_button_container_(NULL),
height_(0),
mode_(MODE_INACTIVE),
@@ -215,11 +216,11 @@ void DefaultHeaderPainter::LayoutHeader() {
if (window_icon_) {
// Vertically center the window icon with respect to the caption button
// container.
- int icon_size = HeaderPainterUtil::GetIconSize();
// Floor when computing the center of |caption_button_container_|.
- int icon_offset_y = caption_button_container_->height() / 2 - icon_size / 2;
+ int icon_offset_y =
+ caption_button_container_->height() / 2 - window_icon_size_ / 2;
window_icon_->SetBounds(HeaderPainterUtil::GetIconXOffset(), icon_offset_y,
- icon_size, icon_size);
+ window_icon_size_, window_icon_size_);
}
// The header/content separator line overlays the caption buttons.
@@ -238,6 +239,12 @@ void DefaultHeaderPainter::SchedulePaintForTitle() {
view_->SchedulePaintInRect(GetTitleBounds());
}
+void DefaultHeaderPainter::UpdateWindowIcon(views::View* window_icon,
+ int window_icon_size) {
+ window_icon_ = window_icon;
+ window_icon_size_ = window_icon_size;
+}
+
///////////////////////////////////////////////////////////////////////////////
// gfx::AnimationDelegate overrides:
diff --git a/ash/frame/default_header_painter.h b/ash/frame/default_header_painter.h
index 80990c1..b664d59 100644
--- a/ash/frame/default_header_painter.h
+++ b/ash/frame/default_header_painter.h
@@ -46,6 +46,9 @@ class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter,
virtual void SetHeaderHeightForPainting(int height) OVERRIDE;
virtual void SchedulePaintForTitle() OVERRIDE;
+ // Sets the window icon for the header. Passing NULL removes the window icon.
+ void UpdateWindowIcon(views::View* window_icon, int icon_size);
+
private:
FRIEND_TEST_ALL_PREFIXES(DefaultHeaderPainterTest, TitleIconAlignment);
@@ -73,6 +76,7 @@ class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter,
views::Widget* frame_;
views::View* view_;
views::View* window_icon_; // May be NULL.
+ int window_icon_size_;
FrameCaptionButtonContainerView* caption_button_container_;
// The height of the header including the header/content separator.
diff --git a/ash/frame/header_painter_util.cc b/ash/frame/header_painter_util.cc
index ca83824..1054291 100644
--- a/ash/frame/header_painter_util.cc
+++ b/ash/frame/header_painter_util.cc
@@ -22,8 +22,8 @@ const int kTopCornerRadiusWhenRestored = 2;
// Distance between left edge of the window and the header icon.
const int kIconXOffset = 9;
-// Height and width of header icon.
-const int kIconSize = 16;
+// Default height and width of header icon.
+const int kDefaultIconSize = 16;
// Space between the title text and the caption buttons.
const int kTitleCaptionButtonSpacing = 5;
@@ -57,8 +57,8 @@ int HeaderPainterUtil::GetIconXOffset() {
}
// static
-int HeaderPainterUtil::GetIconSize() {
- return kIconSize;
+int HeaderPainterUtil::GetDefaultIconSize() {
+ return kDefaultIconSize;
}
// static
diff --git a/ash/frame/header_painter_util.h b/ash/frame/header_painter_util.h
index 468184a..5e4bde4 100644
--- a/ash/frame/header_painter_util.h
+++ b/ash/frame/header_painter_util.h
@@ -31,7 +31,7 @@ class ASH_EXPORT HeaderPainterUtil {
static int GetIconXOffset();
// Returns the size of the header icon.
- static int GetIconSize();
+ static int GetDefaultIconSize();
// Returns the amount that the frame background is inset from the left edge of
// the window.
diff --git a/ash/session_state_delegate.h b/ash/session_state_delegate.h
index 4df1617..f0e7f22 100644
--- a/ash/session_state_delegate.h
+++ b/ash/session_state_delegate.h
@@ -51,6 +51,10 @@ class ASH_EXPORT SessionStateDelegate {
virtual content::BrowserContext* GetBrowserContextByIndex(
MultiProfileIndex index) = 0;
+ // Returns the browser context associated with the window.
+ virtual content::BrowserContext* GetBrowserContextForWindow(
+ aura::Window* window) = 0;
+
// Returns the maximum possible number of logged in users.
virtual int GetMaximumNumberOfLoggedInUsers() const = 0;
diff --git a/ash/session_state_delegate_stub.cc b/ash/session_state_delegate_stub.cc
index 7fc01da..dcbd346 100644
--- a/ash/session_state_delegate_stub.cc
+++ b/ash/session_state_delegate_stub.cc
@@ -6,6 +6,7 @@
#include "ash/shell.h"
#include "ash/shell/example_factory.h"
+#include "ash/shell_delegate.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
@@ -20,7 +21,13 @@ SessionStateDelegateStub::~SessionStateDelegateStub() {
content::BrowserContext*
SessionStateDelegateStub::GetBrowserContextByIndex(
MultiProfileIndex index) {
- return NULL;
+ return Shell::GetInstance()->delegate()->GetActiveBrowserContext();
+}
+
+content::BrowserContext*
+SessionStateDelegateStub::GetBrowserContextForWindow(
+ aura::Window* window) {
+ return Shell::GetInstance()->delegate()->GetActiveBrowserContext();
}
int SessionStateDelegateStub::GetMaximumNumberOfLoggedInUsers() const {
@@ -79,11 +86,11 @@ const std::string SessionStateDelegateStub::GetUserID(
const gfx::ImageSkia& SessionStateDelegateStub::GetUserImage(
content::BrowserContext* context) const {
- return null_image_;
+ return user_image_;
}
bool SessionStateDelegateStub::ShouldShowAvatar(aura::Window* window) {
- return false;
+ return !user_image_.isNull();
}
void SessionStateDelegateStub::SwitchActiveUser(const std::string& user_id) {
diff --git a/ash/session_state_delegate_stub.h b/ash/session_state_delegate_stub.h
index 8c27e9a..5693fa7 100644
--- a/ash/session_state_delegate_stub.h
+++ b/ash/session_state_delegate_stub.h
@@ -21,6 +21,8 @@ class SessionStateDelegateStub : 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;
@@ -50,7 +52,7 @@ class SessionStateDelegateStub : public SessionStateDelegate {
bool screen_locked_;
// A pseudo user image.
- gfx::ImageSkia null_image_;
+ gfx::ImageSkia user_image_;
DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub);
};
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);
};
diff --git a/chrome/browser/ui/ash/session_state_delegate_chromeos.cc b/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
index 4dd49cc..2341781 100644
--- a/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
@@ -38,6 +38,16 @@ content::BrowserContext* SessionStateDelegateChromeos::GetBrowserContextByIndex(
return chromeos::UserManager::Get()->GetProfileByUser(user);
}
+content::BrowserContext*
+SessionStateDelegateChromeos::GetBrowserContextForWindow(
+ aura::Window* window) {
+ const std::string& user_id =
+ chrome::MultiUserWindowManager::GetInstance()->GetWindowOwner(window);
+ const chromeos::User* user = chromeos::UserManager::Get()->FindUser(user_id);
+ DCHECK(user);
+ return chromeos::UserManager::Get()->GetProfileByUser(user);
+}
+
int SessionStateDelegateChromeos::GetMaximumNumberOfLoggedInUsers() const {
// We limit list of logged in users to 10 due to memory constraints.
// Note that 10 seems excessive, but we want to test how many users are
diff --git a/chrome/browser/ui/ash/session_state_delegate_chromeos.h b/chrome/browser/ui/ash/session_state_delegate_chromeos.h
index 89a7d95..b6dc922 100644
--- a/chrome/browser/ui/ash/session_state_delegate_chromeos.h
+++ b/chrome/browser/ui/ash/session_state_delegate_chromeos.h
@@ -25,6 +25,8 @@ class SessionStateDelegateChromeos
// ash::SessionStateDelegate:
virtual content::BrowserContext* GetBrowserContextByIndex(
ash::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;
diff --git a/chrome/browser/ui/ash/session_state_delegate_views.cc b/chrome/browser/ui/ash/session_state_delegate_views.cc
index cac69f9..c8c1033 100644
--- a/chrome/browser/ui/ash/session_state_delegate_views.cc
+++ b/chrome/browser/ui/ash/session_state_delegate_views.cc
@@ -26,6 +26,12 @@ content::BrowserContext* SessionStateDelegate::GetBrowserContextByIndex(
return NULL;
}
+content::BrowserContext* SessionStateDelegate::GetBrowserContextForWindow(
+ aura::Window* window) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
int SessionStateDelegate::GetMaximumNumberOfLoggedInUsers() const {
return 3;
}
diff --git a/chrome/browser/ui/ash/session_state_delegate_views.h b/chrome/browser/ui/ash/session_state_delegate_views.h
index c9a4f08..549326f 100644
--- a/chrome/browser/ui/ash/session_state_delegate_views.h
+++ b/chrome/browser/ui/ash/session_state_delegate_views.h
@@ -22,6 +22,8 @@ class SessionStateDelegate : public ash::SessionStateDelegate {
// ash::SessionStateDelegate:
virtual content::BrowserContext* GetBrowserContextByIndex(
ash::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;
diff --git a/chrome/browser/ui/views/frame/browser_header_painter_ash.cc b/chrome/browser/ui/views/frame/browser_header_painter_ash.cc
index 34ee202..1467bd7 100644
--- a/chrome/browser/ui/views/frame/browser_header_painter_ash.cc
+++ b/chrome/browser/ui/views/frame/browser_header_painter_ash.cc
@@ -248,7 +248,7 @@ void BrowserHeaderPainterAsh::LayoutHeader() {
if (window_icon_) {
// Vertically center the window icon with respect to the caption button
// container.
- int icon_size = ash::HeaderPainterUtil::GetIconSize();
+ int icon_size = ash::HeaderPainterUtil::GetDefaultIconSize();
int icon_offset_y = (caption_button_container_->height() - icon_size) / 2;
window_icon_->SetBounds(ash::HeaderPainterUtil::GetIconXOffset(),
icon_offset_y, icon_size, icon_size);