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

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: Added comment and tabbed reference 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 681070948c4f13d6ac283afe3058067db774aad9..5fd7b93d7c4798d96abee69771e0de08b3005400 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
@@ -42,6 +42,8 @@ const int kShadowHeightStretch = -1;
class AppNonClientFrameViewAsh::ControlView
: public views::View, public views::ButtonListener {
public:
+ // TODO(skuhne): If we keep the "always maximized" experiment we might want to
+ // make this function be able to work with a |restore_button_| which is NULL.
explicit ControlView(AppNonClientFrameViewAsh* owner) :
owner_(owner),
close_button_(new views::ImageButton(this)),
@@ -69,6 +71,17 @@ 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()) {
+ 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,10 @@ class AppNonClientFrameViewAsh::ControlView
}
virtual gfx::Size GetPreferredSize() OVERRIDE {
- return gfx::Size(shadow_->width(),
+ int maximize_button_deduction = ash::Shell::IsForcedMaximizeMode() ?
+ restore_button_->GetPreferredSize().width() : 0;
+
+ return gfx::Size(shadow_->width() - maximize_button_deduction,
shadow_->height() + kShadowHeightStretch);
}
« no previous file with comments | « chrome/browser/ui/ash/launcher/launcher_context_menu.cc ('k') | chrome/browser/ui/window_sizer/window_sizer_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698