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

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

Issue 13934007: Adding experimental maximize mode (behind a flag) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A few self nits Created 7 years, 8 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/app_non_client_frame_view_ash.cc
diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc
index 2b1bfa71bc56285621d4ce6a58588adba1754029..df7462d25ae8d52cec30db3341106321e03b5f98 100644
--- a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc
+++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc
@@ -45,7 +45,8 @@ class AppNonClientFrameViewAsh::ControlView
explicit ControlView(AppNonClientFrameViewAsh* owner) :
owner_(owner),
close_button_(new views::ImageButton(this)),
- restore_button_(new ash::FrameMaximizeButton(this, owner_))
+ restore_button_(new ash::FrameMaximizeButton(this, owner_)),
+ original_maximize_button_width_(0)
James Cook 2013/04/22 22:15:46 If we're going to do this mode, I think you should
Mr4D (OOO till 08-26) 2013/04/23 04:41:28 Right. As stated in my CL comment: This was a no g
James Cook 2013/04/23 18:27:32 OK. Keep the button hiding the way you have it, bu
Mr4D (OOO till 08-26) 2013/04/23 22:24:00 Added a TODO(skuhne) comment here to make sure it
{
close_button_->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
@@ -69,6 +70,18 @@ class AppNonClientFrameViewAsh::ControlView
virtual ~ControlView() {}
virtual void Layout() OVERRIDE {
+ if (ash::Shell::IsForcedMaximizeMode()) {
+ // TODO(skuhne): If this experiment would get persued, it would be better
+ // to check here the |restore_button_|'s visibility. Furthermore we
+ // should change |shadow_| to a new bitmap which can host only a single
+ // button.
+ gfx::Size size = restore_button_->bounds().size();
+ if (size.width()) {
+ original_maximize_button_width_ = size.width();
+ size.set_width(0);
+ restore_button_->SetSize(size);
+ }
+ }
restore_button_->SetPosition(gfx::Point(kShadowStart, 0));
close_button_->SetPosition(gfx::Point(kShadowStart +
restore_button_->width() - kButtonOverlap, 0));
@@ -92,7 +105,7 @@ class AppNonClientFrameViewAsh::ControlView
}
virtual gfx::Size GetPreferredSize() OVERRIDE {
- return gfx::Size(shadow_->width(),
+ return gfx::Size(shadow_->width() - original_maximize_button_width_,
shadow_->height() + kShadowHeightStretch);
}
@@ -153,6 +166,9 @@ class AppNonClientFrameViewAsh::ControlView
const gfx::ImageSkia* control_base_;
const gfx::ImageSkia* shadow_;
+ // The original size of the maximize button.
+ int original_maximize_button_width_;
+
DISALLOW_COPY_AND_ASSIGN(ControlView);
};

Powered by Google App Engine
This is Rietveld 408576698