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

Unified Diff: ash/common/frame/default_header_painter.cc

Issue 2724693002: mash: improves browser frame decorations (Closed)
Patch Set: merge Created 3 years, 9 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
« no previous file with comments | « ash/common/frame/default_header_painter.h ('k') | ash/common/frame/header_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/frame/default_header_painter.cc
diff --git a/ash/common/frame/default_header_painter.cc b/ash/common/frame/default_header_painter.cc
index 519cfe2e7ad68b5b7594ece576bb2dd1c5acb211..32f24601950f77838e4465f9243eea487696b91f 100644
--- a/ash/common/frame/default_header_painter.cc
+++ b/ash/common/frame/default_header_painter.cc
@@ -77,13 +77,14 @@ namespace ash {
///////////////////////////////////////////////////////////////////////////////
// DefaultHeaderPainter, public:
-DefaultHeaderPainter::DefaultHeaderPainter()
- : frame_(NULL),
- view_(NULL),
- left_header_view_(NULL),
+DefaultHeaderPainter::DefaultHeaderPainter(mojom::WindowStyle window_style)
+ : window_style_(window_style),
+ frame_(nullptr),
+ view_(nullptr),
+ left_header_view_(nullptr),
active_frame_color_(kDefaultFrameColor),
inactive_frame_color_(kDefaultFrameColor),
- caption_button_container_(NULL),
+ caption_button_container_(nullptr),
painted_height_(0),
mode_(MODE_INACTIVE),
initial_paint_(true),
@@ -156,6 +157,16 @@ void DefaultHeaderPainter::PaintHeader(gfx::Canvas* canvas, Mode mode) {
}
void DefaultHeaderPainter::LayoutHeader() {
+ // TODO(sky): this needs to reset images as well.
+ if (window_style_ == mojom::WindowStyle::BROWSER) {
+ const bool use_maximized_size =
+ frame_->IsMaximized() || frame_->IsFullscreen();
+ const gfx::Size button_size(GetAshLayoutSize(
+ use_maximized_size ? AshLayoutSize::BROWSER_MAXIMIZED_CAPTION_BUTTON
+ : AshLayoutSize::BROWSER_RESTORED_CAPTION_BUTTON));
+ caption_button_container_->SetButtonSize(button_size);
+ }
+
caption_button_container_->SetUseLightImages(ShouldUseLightImages());
UpdateSizeButtonImages();
caption_button_container_->Layout();
« no previous file with comments | « ash/common/frame/default_header_painter.h ('k') | ash/common/frame/header_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698