summaryrefslogtreecommitdiffstats
path: root/ash/wm/workspace
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-31 21:32:52 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-31 21:32:52 +0000
commitd148d3b78afa7d5bb9c8f21f086b1d28fccb8d93 (patch)
treef659e47eabf9bccee3663e2c545cd17b242ffa11 /ash/wm/workspace
parent7e1117ccfd480267ebda3e64042f01c86e803cd8 (diff)
downloadchromium_src-d148d3b78afa7d5bb9c8f21f086b1d28fccb8d93.zip
chromium_src-d148d3b78afa7d5bb9c8f21f086b1d28fccb8d93.tar.gz
chromium_src-d148d3b78afa7d5bb9c8f21f086b1d28fccb8d93.tar.bz2
Changes the maximize button to only minimize for panels. This resulted
in a slew of renaming. Currently the icons are completely wrong for this, but that should be fixed once we get the assets. BUG=121221 TEST=none R=jamescook@chromium.org Review URL: https://chromiumcodereview.appspot.com/9958039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130064 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/workspace')
-rw-r--r--ash/wm/workspace/frame_maximize_button.cc22
-rw-r--r--ash/wm/workspace/frame_maximize_button.h12
2 files changed, 4 insertions, 30 deletions
diff --git a/ash/wm/workspace/frame_maximize_button.cc b/ash/wm/workspace/frame_maximize_button.cc
index 6b63310..715d74c 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 {
diff --git a/ash/wm/workspace/frame_maximize_button.h b/ash/wm/workspace/frame_maximize_button.h
index 04892b8..99e12f4 100644
--- a/ash/wm/workspace/frame_maximize_button.h
+++ b/ash/wm/workspace/frame_maximize_button.h
@@ -36,11 +36,6 @@ class ASH_EXPORT FrameMaximizeButton : public views::ImageButton {
virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;
virtual void OnMouseCaptureLost() OVERRIDE;
- // Sets is_left_right_enabled_ and updates tooltip.
- void SetIsLeftRightEnabled(bool e);
-
- void set_is_maximize_enabled(bool e) { is_maximize_enabled_ = e; }
-
protected:
// ImageButton overrides:
virtual SkBitmap GetImageToPaint() OVERRIDE;
@@ -72,9 +67,6 @@ class ASH_EXPORT FrameMaximizeButton : public views::ImageButton {
// Updates |snap_type_| based on a mouse drag.
void UpdateSnap(const gfx::Point& location);
- // Returns true if maximizing is allowed.
- bool AllowMaximize() const;
-
// Returns the type of snap based on the specified location.
SnapType SnapTypeForLocation(const gfx::Point& location) const;
@@ -98,10 +90,6 @@ class ASH_EXPORT FrameMaximizeButton : public views::ImageButton {
// should show the snap locations.
bool is_snap_enabled_;
- // Selectively enable/disable button functionality.
- bool is_left_right_enabled_;
- bool is_maximize_enabled_;
-
// Did the user drag far enough to trigger snapping?
bool exceeded_drag_threshold_;