| 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 {
|
|
|