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

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

Issue 9956063: Merge 130064 - Changes the maximize button to only minimize for panels. This resulted (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
Patch Set: 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
===================================================================
--- ash/wm/workspace/frame_maximize_button.cc (revision 130125)
+++ ash/wm/workspace/frame_maximize_button.cc (working copy)
@@ -96,8 +96,6 @@
: 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.
@@ -164,14 +162,6 @@
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;
@@ -273,25 +263,19 @@
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_NONE;
+ 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;
- else if (AllowMaximize())
- return SNAP_MAXIMIZE;
- return SNAP_NONE;
+ return !frame_->GetWidget()->IsMaximized() ? SNAP_MAXIMIZE : SNAP_RESTORE;
}
gfx::Rect FrameMaximizeButton::BoundsForType(SnapType type) const {
« no previous file with comments | « ash/wm/workspace/frame_maximize_button.h ('k') | chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698