Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1720)

Unified Diff: chrome/browser/ui/views/frame/browser_header_painter_ash.cc

Issue 441803004: Introduce new WebApp header style for hosted apps and fizzy apps on ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_header_painter_ash.cc
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 be2dbc75e27497608f0689bf925628f852811823..f326404f44a6253deaf7b76902aa9bf27c6072a1 100644
--- a/chrome/browser/ui/views/frame/browser_header_painter_ash.cc
+++ b/chrome/browser/ui/views/frame/browser_header_painter_ash.cc
@@ -114,6 +114,7 @@ BrowserHeaderPainterAsh::BrowserHeaderPainterAsh()
is_incognito_(false),
view_(NULL),
window_icon_(NULL),
+ window_icon_x_inset_(ash::HeaderPainterUtil::GetDefaultLeftViewXInset()),
caption_button_container_(NULL),
painted_height_(0),
initial_paint_(true),
@@ -245,10 +246,13 @@ void BrowserHeaderPainterAsh::LayoutHeader() {
if (window_icon_) {
// Vertically center the window icon with respect to the caption button
// container.
- 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);
+ gfx::Size icon_size(window_icon_->GetPreferredSize());
+ int icon_offset_y = (caption_button_container_->height() -
+ icon_size.height()) / 2;
+ window_icon_->SetBounds(window_icon_x_inset_,
+ icon_offset_y,
+ icon_size.width(),
+ icon_size.height());
}
}
@@ -264,6 +268,10 @@ void BrowserHeaderPainterAsh::SchedulePaintForTitle() {
view_->SchedulePaintInRect(GetTitleBounds());
}
+void BrowserHeaderPainterAsh::UpdateLeftViewXInset(int left_view_x_inset) {
+ window_icon_x_inset_ = left_view_x_inset;
+}
+
///////////////////////////////////////////////////////////////////////////////
// gfx::AnimationDelegate overrides:

Powered by Google App Engine
This is Rietveld 408576698