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

Unified Diff: ash/wm/workspace/frame_maximize_button.cc

Issue 9958039: Changes the maximize button to only minimize for panels. This resulted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Spelling Created 8 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
Index: ash/wm/workspace/frame_maximize_button.cc
diff --git a/ash/wm/workspace/frame_maximize_button.cc b/ash/wm/workspace/frame_maximize_button.cc
index 6b633104da27db51008a35126382a5f2dd25f475..715d74c184b753b2f46d8ecaf40255036068756b 100644
--- a/ash/wm/workspace/frame_maximize_button.cc
+++ b/ash/wm/workspace/frame_maximize_button.cc
@@ -103,8 +103,6 @@ FrameMaximizeButton::FrameMaximizeButton(views::ButtonListener* listener,
: ImageButton(listener),
frame_(frame),
is_snap_enabled_(false),
- is_left_right_enabled_(true),
- is_maximize_enabled_(true),
exceeded_drag_threshold_(false),
snap_type_(SNAP_NONE) {
// TODO(sky): nuke this. It's temporary while we don't have good images.
@@ -176,14 +174,6 @@ void FrameMaximizeButton::OnMouseCaptureLost() {
ImageButton::OnMouseCaptureLost();
}
-void FrameMaximizeButton::SetIsLeftRightEnabled(bool e) {
- is_left_right_enabled_ = e;
- int id = is_left_right_enabled_ ?
- IDS_FRAME_MAXIMIZE_BUTTON_TOOLTIP :
- IDS_FRAME_MAXIMIZE_BUTTON_NO_SIDE_SNAP_TOOLTIP;
- SetTooltipText(l10n_util::GetStringUTF16(id));
-}
-
SkBitmap FrameMaximizeButton::GetImageToPaint() {
if (is_snap_enabled_) {
int id = 0;
@@ -298,23 +288,19 @@ void FrameMaximizeButton::UpdateSnap(const gfx::Point& location) {
phantom_window_->Show(BoundsForType(snap_type_));
}
-bool FrameMaximizeButton::AllowMaximize() const {
- return !frame_->GetWidget()->IsMaximized() && is_maximize_enabled_;
-}
-
FrameMaximizeButton::SnapType FrameMaximizeButton::SnapTypeForLocation(
const gfx::Point& location) const {
int delta_x = location.x() - press_location_.x();
int delta_y = location.y() - press_location_.y();
if (!views::View::ExceededDragThreshold(delta_x, delta_y))
- return AllowMaximize() ? SNAP_MAXIMIZE : SNAP_RESTORE;
+ return !frame_->GetWidget()->IsMaximized() ? SNAP_MAXIMIZE : SNAP_RESTORE;
else if (delta_x < 0 && delta_y > delta_x && delta_y < -delta_x)
- return is_left_right_enabled_ ? SNAP_LEFT : SNAP_NONE;
+ return SNAP_LEFT;
else if (delta_x > 0 && delta_y > -delta_x && delta_y < delta_x)
- return is_left_right_enabled_ ? SNAP_RIGHT : SNAP_NONE;
+ return SNAP_RIGHT;
else if (delta_y > 0)
return SNAP_MINIMIZE;
- return AllowMaximize() ? SNAP_MAXIMIZE : SNAP_RESTORE;
+ return !frame_->GetWidget()->IsMaximized() ? SNAP_MAXIMIZE : SNAP_RESTORE;
}
gfx::Rect FrameMaximizeButton::BoundsForType(SnapType type) const {

Powered by Google App Engine
This is Rietveld 408576698