diff options
author | jonross@chromium.org <jonross@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-22 22:50:46 +0000 |
---|---|---|
committer | jonross@chromium.org <jonross@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-22 22:50:46 +0000 |
commit | 605f9139f3d61b6f87da5ef281dfd3995316e2b2 (patch) | |
tree | 57d058e0613f0bc60268358e50ca59244ddeecc3 /ash | |
parent | 77161173bbbda225116e2380e9de2e1368ffa4d6 (diff) | |
download | chromium_src-605f9139f3d61b6f87da5ef281dfd3995316e2b2.zip chromium_src-605f9139f3d61b6f87da5ef281dfd3995316e2b2.tar.gz chromium_src-605f9139f3d61b6f87da5ef281dfd3995316e2b2.tar.bz2 |
Reland Linux Window Control Alignment
Modifying CustomFrameView to layout window controls based on user configurations. For linux begin observing the configs and changes. For other systems fall back on a default ordering.
Update tests that were originally missed.
Original review: https://codereview.chromium.org/240163006/
Revert review: https://codereview.chromium.org/276173002/
Revert "Revert of Linux Aura Task Manager Frame Buttons Misaligned (https://codereview.chromium.org/240163006/)"
This reverts commit 9031ef57ba679037fc675bf2f081f3880380de3a.
TEST=CustomFrameViewTest
BUG=351917
Review URL: https://codereview.chromium.org/281353009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272352 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/extended_desktop_unittest.cc | 6 | ||||
-rw-r--r-- | ash/wm/system_gesture_event_filter_unittest.cc | 21 |
2 files changed, 22 insertions, 5 deletions
diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc index 4ad8301..eb8591d 100644 --- a/ash/extended_desktop_unittest.cc +++ b/ash/extended_desktop_unittest.cc @@ -518,7 +518,7 @@ TEST_F(ExtendedDesktopTest, MoveWindowWithTransient) { w1, gfx::Rect(50, 50, 50, 50), false /* transient */); // Transient child of the transient child. views::Widget* w1_t11 = CreateTestWidgetWithParent( - w1_t1, gfx::Rect(1200, 70, 30, 30), false /* transient */); + w1_t1, gfx::Rect(1200, 70, 35, 35), false /* transient */); views::Widget* w11 = CreateTestWidgetWithParent( w1, gfx::Rect(10, 10, 40, 40), true /* child */); @@ -532,7 +532,7 @@ TEST_F(ExtendedDesktopTest, MoveWindowWithTransient) { EXPECT_EQ(root_windows[0], w11_t1->GetNativeView()->GetRootWindow()); EXPECT_EQ("50,50 50x50", w1_t1->GetWindowBoundsInScreen().ToString()); - EXPECT_EQ("1200,70 30x30", + EXPECT_EQ("1200,70 35x35", w1_t11->GetWindowBoundsInScreen().ToString()); EXPECT_EQ("20,20 40x40", w11->GetWindowBoundsInScreen().ToString()); @@ -552,7 +552,7 @@ TEST_F(ExtendedDesktopTest, MoveWindowWithTransient) { // Transient window's screen bounds stays the same. EXPECT_EQ("50,50 50x50", w1_t1->GetWindowBoundsInScreen().ToString()); - EXPECT_EQ("1200,70 30x30", + EXPECT_EQ("1200,70 35x35", w1_t11->GetWindowBoundsInScreen().ToString()); EXPECT_EQ("1300,100 80x80", w11_t1->GetWindowBoundsInScreen().ToString()); diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc index 072a714..ee2a20f 100644 --- a/ash/wm/system_gesture_event_filter_unittest.cc +++ b/ash/wm/system_gesture_event_filter_unittest.cc @@ -4,6 +4,8 @@ #include "ash/wm/system_gesture_event_filter.h" +#include <vector> + #include "ash/accelerators/accelerator_controller.h" #include "ash/ash_switches.h" #include "ash/display/display_manager.h" @@ -38,6 +40,7 @@ #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/window/non_client_view.h" +#include "ui/views/window/window_button_order_provider.h" namespace ash { namespace test { @@ -138,6 +141,20 @@ class SystemGestureEventFilterTest // Overridden from AshTestBase: virtual void SetUp() OVERRIDE { + // TODO(jonross): TwoFingerDragDelayed() and ThreeFingerGestureStopsDrag() + // both use hardcoded touch points, assuming that they target empty header + // space. Window control order now reflects configuration files and can + // change. The tests should be improved to dynamically decide touch points. + // To address this we specify the originally expected window control + // positions to be consistent across tests. + std::vector<views::FrameButton> leading; + std::vector<views::FrameButton> trailing; + trailing.push_back(views::FRAME_BUTTON_MINIMIZE); + trailing.push_back(views::FRAME_BUTTON_MAXIMIZE); + trailing.push_back(views::FRAME_BUTTON_CLOSE); + views::WindowButtonOrderProvider::GetInstance()-> + SetWindowButtonOrder(leading, trailing); + if (!docked_enabled_) { CommandLine::ForCurrentProcess()->AppendSwitch( ash::switches::kAshDisableDockedWindows); @@ -437,7 +454,7 @@ TEST_P(SystemGestureEventFilterTest, } TEST_P(SystemGestureEventFilterTest, TwoFingerDragDelayed) { - gfx::Rect bounds(0, 0, 100, 100); + gfx::Rect bounds(0, 0, 200, 100); aura::Window* root_window = Shell::GetPrimaryRootWindow(); views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds( new ResizableWidgetDelegate, root_window, bounds); @@ -472,7 +489,7 @@ TEST_P(SystemGestureEventFilterTest, TwoFingerDragDelayed) { } TEST_P(SystemGestureEventFilterTest, ThreeFingerGestureStopsDrag) { - gfx::Rect bounds(0, 0, 100, 100); + gfx::Rect bounds(0, 0, 200, 100); aura::Window* root_window = Shell::GetPrimaryRootWindow(); views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds( new ResizableWidgetDelegate, root_window, bounds); |