summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-13 22:13:35 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-13 22:13:35 +0000
commit971fc42c156169b23bd75854e8d0192d14ce86fc (patch)
tree4eeda4b8a17ebbe324d44a7abcbe5fa4545a5430 /ash
parent84be0170ee29b6ded7b873513df1c4ff7c9833fc (diff)
downloadchromium_src-971fc42c156169b23bd75854e8d0192d14ce86fc.zip
chromium_src-971fc42c156169b23bd75854e8d0192d14ce86fc.tar.gz
chromium_src-971fc42c156169b23bd75854e8d0192d14ce86fc.tar.bz2
Removes FrameBuffer::AdjustFrameHitCodeForMaximizedModes.
BUG=235440 TEST=manually Review URL: https://chromiumcodereview.appspot.com/15030010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199833 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/wm/frame_painter.cc38
-rw-r--r--ash/wm/frame_painter.h3
-rw-r--r--ash/wm/frame_painter_unittest.cc35
3 files changed, 0 insertions, 76 deletions
diff --git a/ash/wm/frame_painter.cc b/ash/wm/frame_painter.cc
index d23a6df..287c5a7 100644
--- a/ash/wm/frame_painter.cc
+++ b/ash/wm/frame_painter.cc
@@ -306,7 +306,6 @@ int FramePainter::NonClientHitTest(views::NonClientFrameView* view,
kResizeAreaCornerSize,
kResizeAreaCornerSize,
can_ever_resize);
- frame_component = AdjustFrameHitCodeForMaximizedModes(frame_component);
if (frame_component != HTNOWHERE)
return frame_component;
@@ -774,43 +773,6 @@ int FramePainter::GetHeaderOpacity(HeaderMode header_mode,
return kInactiveWindowOpacity;
}
-int FramePainter::AdjustFrameHitCodeForMaximizedModes(int hit_code) {
- if (hit_code != HTNOWHERE && wm::IsWindowNormal(window_) &&
- GetRestoreBoundsInScreen(window_)) {
- // When there is a restore rectangle, a left/right maximized window might
- // be active.
- const gfx::Rect& bounds = frame_->GetWindowBoundsInScreen();
- const gfx::Rect& screen =
- Shell::GetScreen()->GetDisplayMatching(bounds).work_area();
- if (bounds.y() == screen.y() && bounds.bottom() == screen.bottom()) {
- // The window is probably either left or right maximized.
- if (bounds.x() == screen.x()) {
- // It is left maximized and we can only allow a right resize.
- return (hit_code == HTBOTTOMRIGHT ||
- hit_code == HTTOPRIGHT ||
- hit_code == HTRIGHT) ? HTRIGHT : HTNOWHERE;
- } else if (bounds.right() == screen.right()) {
- // It is right maximized and we can only allow a left resize.
- return (hit_code == HTBOTTOMLEFT ||
- hit_code == HTTOPLEFT ||
- hit_code == HTLEFT) ? HTLEFT : HTNOWHERE;
- }
- } else if (bounds.x() == screen.x() &&
- bounds.right() == screen.right()) {
- // If horizontal fill mode is activated we don't allow a left/right
- // resizing.
- if (hit_code == HTTOPRIGHT ||
- hit_code == HTTOP ||
- hit_code == HTTOPLEFT)
- return HTTOP;
- return (hit_code == HTBOTTOMRIGHT ||
- hit_code == HTBOTTOM ||
- hit_code == HTBOTTOMLEFT) ? HTBOTTOM : HTNOWHERE;
- }
- }
- return hit_code;
-}
-
bool FramePainter::IsCyclingThroughWorkspaces() const {
aura::RootWindow* root = window_->GetRootWindow();
return root && root->GetProperty(internal::kCyclingThroughWorkspacesKey);
diff --git a/ash/wm/frame_painter.h b/ash/wm/frame_painter.h
index 5b8f3df..fce61ad 100644
--- a/ash/wm/frame_painter.h
+++ b/ash/wm/frame_painter.h
@@ -168,9 +168,6 @@ class ASH_EXPORT FramePainter : public aura::WindowObserver,
int theme_frame_id,
const gfx::ImageSkia* theme_frame_overlay);
- // Adjust frame operations for left / right maximized modes.
- int AdjustFrameHitCodeForMaximizedModes(int hit_code);
-
// Returns true if the user is cycling through workspaces.
bool IsCyclingThroughWorkspaces() const;
diff --git a/ash/wm/frame_painter_unittest.cc b/ash/wm/frame_painter_unittest.cc
index 275c484..c72649b 100644
--- a/ash/wm/frame_painter_unittest.cc
+++ b/ash/wm/frame_painter_unittest.cc
@@ -646,39 +646,4 @@ TEST_F(FramePainterTest, GetHeaderOpacity) {
NULL));
}
-// Test the hit test function with windows which are "partially maximized".
-TEST_F(FramePainterTest, HitTestSpecialMaximizedModes) {
- // Create a widget and a painter for it.
- scoped_ptr<Widget> w1(CreateResizableWidget());
- FramePainter p1;
- ImageButton size1(NULL);
- ImageButton close1(NULL);
- p1.Init(w1.get(), NULL, &size1, &close1, FramePainter::SIZE_BUTTON_MAXIMIZES);
- views::NonClientFrameView* frame = w1->non_client_view()->frame_view();
- w1->Show();
- gfx::Rect any_rect = gfx::Rect(0, 0, 100, 100);
- gfx::Rect screen = Shell::GetScreen()->GetDisplayMatching(
- any_rect).work_area();
- w1->SetBounds(any_rect);
- EXPECT_EQ(HTTOPLEFT, p1.NonClientHitTest(frame, gfx::Point(0, 15)));
- w1->SetBounds(gfx::Rect(
- screen.x(), screen.y(), screen.width() / 2, screen.height()));
- // A hit without a set restore rect should produce a top left hit.
- EXPECT_EQ(HTTOPLEFT, p1.NonClientHitTest(frame, gfx::Point(0, 15)));
- ash::SetRestoreBoundsInScreen(w1->GetNativeWindow(), any_rect);
- // A hit into the corner should produce nowhere - not left.
- EXPECT_EQ(HTCAPTION, p1.NonClientHitTest(frame, gfx::Point(0, 15)));
- // A hit into the middle upper area should generate right - not top&right.
- EXPECT_EQ(HTRIGHT,
- p1.NonClientHitTest(frame, gfx::Point(screen.width() / 2, 15)));
- // A hit into the middle should generate right.
- EXPECT_EQ(HTRIGHT,
- p1.NonClientHitTest(frame, gfx::Point(screen.width() / 2,
- screen.height() / 2)));
- // A hit into the middle lower area should generate right - not bottom&right.
- EXPECT_EQ(HTRIGHT,
- p1.NonClientHitTest(frame, gfx::Point(screen.width() / 2,
- screen.height() - 1)));
-}
-
} // namespace ash