summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorvarkha@chromium.org <varkha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 21:36:22 +0000
committervarkha@chromium.org <varkha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 21:36:22 +0000
commitaeb3b8441ad78fe9a7bbfea3afb2ab8c10bb9910 (patch)
tree5e8048fc01661b4ff93c9c08e9c54d4777ffb9e3 /ash
parent03f57125c93b8c60d7ab964be77b8ad17f287917 (diff)
downloadchromium_src-aeb3b8441ad78fe9a7bbfea3afb2ab8c10bb9910.zip
chromium_src-aeb3b8441ad78fe9a7bbfea3afb2ab8c10bb9910.tar.gz
chromium_src-aeb3b8441ad78fe9a7bbfea3afb2ab8c10bb9910.tar.bz2
Removes --ash_disable-docked-windows flag
The feature launched in Chrome OS in M-34 so no need to keep the flag anymore. BUG=227223 TEST=Visual 1. in chrome://flags verify that ash-disable-docked-windows is absent. 2. When running chrome it should be possible to dock a window at a screen edge. TEST=ash_unittests --gtest_filter=*Dock* Review URL: https://codereview.chromium.org/305813002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/ash_switches.cc7
-rw-r--r--ash/ash_switches.h4
-rw-r--r--ash/shelf/shelf_window_watcher.cc5
-rw-r--r--ash/wm/dock/docked_window_layout_manager.cc3
-rw-r--r--ash/wm/system_gesture_event_filter_unittest.cc45
-rw-r--r--ash/wm/workspace/workspace_window_resizer.cc3
-rw-r--r--ash/wm/workspace/workspace_window_resizer_unittest.cc7
-rw-r--r--ash/wm/workspace_controller_unittest.cc26
8 files changed, 20 insertions, 80 deletions
diff --git a/ash/ash_switches.cc b/ash/ash_switches.cc
index 327e7ea..75af414 100644
--- a/ash/ash_switches.cc
+++ b/ash/ash_switches.cc
@@ -38,9 +38,6 @@ const char kAshDefaultWallpaperIsOem[] = "ash-default-wallpaper-is-oem";
const char kAshDefaultWallpaperLarge[] = "ash-default-wallpaper-large";
const char kAshDefaultWallpaperSmall[] = "ash-default-wallpaper-small";
-// Disable ability to dock windows at the desktop edge.
-const char kAshDisableDockedWindows[] = "ash-disable-docked-windows";
-
// Disable the Touch Exploration Mode. Touch Exploration Mode will no longer be
// turned on automatically when spoken feedback is enabled when this flag is
// set.
@@ -111,9 +108,5 @@ const char kForceAshToDesktop[] = "ash-force-desktop";
#endif
-bool UseDockedWindows() {
- return !CommandLine::ForCurrentProcess()->HasSwitch(kAshDisableDockedWindows);
-}
-
} // namespace switches
} // namespace ash
diff --git a/ash/ash_switches.h b/ash/ash_switches.h
index 8851510..dc78953 100644
--- a/ash/ash_switches.h
+++ b/ash/ash_switches.h
@@ -24,7 +24,6 @@ ASH_EXPORT extern const char kAshDebugShortcuts[];
ASH_EXPORT extern const char kAshDefaultWallpaperIsOem[];
ASH_EXPORT extern const char kAshDefaultWallpaperLarge[];
ASH_EXPORT extern const char kAshDefaultWallpaperSmall[];
-ASH_EXPORT extern const char kAshDisableDockedWindows[];
ASH_EXPORT extern const char kAshDisableTouchExplorationMode[];
#if defined(OS_CHROMEOS)
ASH_EXPORT extern const char kAshEnableMagnifierKeyScroller[];
@@ -48,9 +47,6 @@ ASH_EXPORT extern const char kForceAshToDesktop[];
// Returns true if items can be dragged off the shelf to unpin.
ASH_EXPORT bool UseDragOffShelf();
-// Returns true if docked windows feature is enabled.
-ASH_EXPORT bool UseDockedWindows();
-
#if defined(OS_CHROMEOS)
// Returns true if a notification should appear when a low-power USB charger
// is connected.
diff --git a/ash/shelf/shelf_window_watcher.cc b/ash/shelf/shelf_window_watcher.cc
index 8cc31b6..3744687 100644
--- a/ash/shelf/shelf_window_watcher.cc
+++ b/ash/shelf/shelf_window_watcher.cc
@@ -4,7 +4,6 @@
#include "ash/shelf/shelf_window_watcher.h"
-#include "ash/ash_switches.h"
#include "ash/display/display_controller.h"
#include "ash/shelf/shelf_constants.h"
#include "ash/shelf/shelf_item_delegate_manager.h"
@@ -86,9 +85,7 @@ void ShelfWindowWatcher::RemovedWindowObserver::OnWindowParentChanged(
// We don't need to check |parent| is default container because this observer
// is already removed from |window| when |window| is re-parented to default
// container.
- if (switches::UseDockedWindows() &&
- IsDragging(window) &&
- parent->id() == kShellWindowId_DockedContainer)
+ if (IsDragging(window) && parent->id() == kShellWindowId_DockedContainer)
return;
// When |window| is re-parented to other containers or |window| is re-parented
diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc
index 4391a7b..7bb93da 100644
--- a/ash/wm/dock/docked_window_layout_manager.cc
+++ b/ash/wm/dock/docked_window_layout_manager.cc
@@ -4,7 +4,6 @@
#include "ash/wm/dock/docked_window_layout_manager.h"
-#include "ash/ash_switches.h"
#include "ash/screen_util.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_constants.h"
@@ -592,8 +591,6 @@ DockedAlignment DockedWindowLayoutManager::CalculateAlignment() const {
bool DockedWindowLayoutManager::CanDockWindow(
aura::Window* window,
DockedAlignment desired_alignment) {
- if (!switches::UseDockedWindows())
- return false;
// Don't allow interactive docking of windows with transient parents such as
// modal browser dialogs. Prevent docking of panels attached to shelf during
// the drag.
diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc
index ee2a20f..e2af719 100644
--- a/ash/wm/system_gesture_event_filter_unittest.cc
+++ b/ash/wm/system_gesture_event_filter_unittest.cc
@@ -7,7 +7,6 @@
#include <vector>
#include "ash/accelerators/accelerator_controller.h"
-#include "ash/ash_switches.h"
#include "ash/display/display_manager.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_model.h"
@@ -20,7 +19,6 @@
#include "ash/wm/gestures/long_press_affordance_handler.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
-#include "base/command_line.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "ui/aura/env.h"
@@ -29,7 +27,6 @@
#include "ui/aura/test/test_windows.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/hit_test.h"
-#include "ui/base/ui_base_switches.h"
#include "ui/events/event.h"
#include "ui/events/event_handler.h"
#include "ui/events/event_utils.h"
@@ -112,11 +109,9 @@ class MaxSizeWidgetDelegate : public views::WidgetDelegateView {
} // namespace
-class SystemGestureEventFilterTest
- : public AshTestBase,
- public testing::WithParamInterface<bool> {
+class SystemGestureEventFilterTest : public AshTestBase {
public:
- SystemGestureEventFilterTest() : AshTestBase(), docked_enabled_(GetParam()) {}
+ SystemGestureEventFilterTest() : AshTestBase() {}
virtual ~SystemGestureEventFilterTest() {}
LongPressAffordanceHandler* GetLongPressAffordance() {
@@ -155,10 +150,6 @@ class SystemGestureEventFilterTest
views::WindowButtonOrderProvider::GetInstance()->
SetWindowButtonOrder(leading, trailing);
- if (!docked_enabled_) {
- CommandLine::ForCurrentProcess()->AppendSwitch(
- ash::switches::kAshDisableDockedWindows);
- }
test::AshTestBase::SetUp();
// Enable brightness key.
test::DisplayManagerTestApi(Shell::GetInstance()->display_manager()).
@@ -166,9 +157,6 @@ class SystemGestureEventFilterTest
}
private:
- // true if docked windows are enabled with a flag.
- bool docked_enabled_;
-
DISALLOW_COPY_AND_ASSIGN(SystemGestureEventFilterTest);
};
@@ -183,7 +171,7 @@ ui::GestureEvent* CreateGesture(ui::EventType type,
ui::GestureEventDetails(type, delta_x, delta_y), 1 << touch_id);
}
-TEST_P(SystemGestureEventFilterTest, LongPressAffordanceStateOnCaptureLoss) {
+TEST_F(SystemGestureEventFilterTest, LongPressAffordanceStateOnCaptureLoss) {
aura::Window* root_window = Shell::GetPrimaryRootWindow();
aura::test::TestWindowDelegate delegate;
@@ -244,7 +232,7 @@ TEST_P(SystemGestureEventFilterTest, LongPressAffordanceStateOnCaptureLoss) {
EXPECT_EQ(NULL, GetLongPressAffordanceView());
}
-TEST_P(SystemGestureEventFilterTest, TwoFingerDrag) {
+TEST_F(SystemGestureEventFilterTest, TwoFingerDrag) {
gfx::Rect bounds(0, 0, 600, 600);
aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
@@ -302,7 +290,7 @@ TEST_P(SystemGestureEventFilterTest, TwoFingerDrag) {
EXPECT_EQ(current_bounds.ToString(), right_tile_bounds.ToString());
}
-TEST_P(SystemGestureEventFilterTest, TwoFingerDragTwoWindows) {
+TEST_F(SystemGestureEventFilterTest, TwoFingerDragTwoWindows) {
aura::Window* root_window = Shell::GetPrimaryRootWindow();
ui::GestureConfiguration::set_max_separation_for_gesture_touches_in_pixels(0);
views::Widget* first = views::Widget::CreateWindowWithContextAndBounds(
@@ -336,7 +324,7 @@ TEST_P(SystemGestureEventFilterTest, TwoFingerDragTwoWindows) {
second->GetWindowBoundsInScreen().ToString());
}
-TEST_P(SystemGestureEventFilterTest, WindowsWithMaxSizeDontSnap) {
+TEST_F(SystemGestureEventFilterTest, WindowsWithMaxSizeDontSnap) {
gfx::Rect bounds(250, 150, 100, 100);
aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
@@ -395,7 +383,7 @@ TEST_P(SystemGestureEventFilterTest, WindowsWithMaxSizeDontSnap) {
toplevel->GetWindowBoundsInScreen().ToString());
}
-TEST_P(SystemGestureEventFilterTest, TwoFingerDragEdge) {
+TEST_F(SystemGestureEventFilterTest, TwoFingerDragEdge) {
gfx::Rect bounds(0, 0, 100, 100);
aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
@@ -425,7 +413,7 @@ TEST_P(SystemGestureEventFilterTest, TwoFingerDragEdge) {
// We do not allow resizing a window via multiple edges simultaneously. Test
// that the behavior is reasonable if a user attempts to resize a window via
// several edges.
-TEST_P(SystemGestureEventFilterTest,
+TEST_F(SystemGestureEventFilterTest,
TwoFingerAttemptResizeLeftAndRightEdgesSimultaneously) {
gfx::Rect initial_bounds(0, 0, 400, 400);
views::Widget* toplevel =
@@ -453,7 +441,7 @@ TEST_P(SystemGestureEventFilterTest,
toplevel->GetNativeWindow()->bounds().ToString());
}
-TEST_P(SystemGestureEventFilterTest, TwoFingerDragDelayed) {
+TEST_F(SystemGestureEventFilterTest, TwoFingerDragDelayed) {
gfx::Rect bounds(0, 0, 200, 100);
aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
@@ -488,7 +476,7 @@ TEST_P(SystemGestureEventFilterTest, TwoFingerDragDelayed) {
toplevel->GetNativeWindow()->bounds().ToString());
}
-TEST_P(SystemGestureEventFilterTest, ThreeFingerGestureStopsDrag) {
+TEST_F(SystemGestureEventFilterTest, ThreeFingerGestureStopsDrag) {
gfx::Rect bounds(0, 0, 200, 100);
aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
@@ -525,7 +513,7 @@ TEST_P(SystemGestureEventFilterTest, ThreeFingerGestureStopsDrag) {
toplevel->GetNativeWindow()->bounds().ToString());
}
-TEST_P(SystemGestureEventFilterTest, DragLeftNearEdgeSnaps) {
+TEST_F(SystemGestureEventFilterTest, DragLeftNearEdgeSnaps) {
gfx::Rect bounds(200, 150, 400, 100);
aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
@@ -553,7 +541,7 @@ TEST_P(SystemGestureEventFilterTest, DragLeftNearEdgeSnaps) {
toplevel_window->bounds().ToString());
}
-TEST_P(SystemGestureEventFilterTest, DragRightNearEdgeSnaps) {
+TEST_F(SystemGestureEventFilterTest, DragRightNearEdgeSnaps) {
gfx::Rect bounds(200, 150, 400, 100);
aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
@@ -580,10 +568,10 @@ TEST_P(SystemGestureEventFilterTest, DragRightNearEdgeSnaps) {
toplevel_window->bounds().ToString());
}
-// Tests that the window manager does not consume gesture events targetted to
+// Tests that the window manager does not consume gesture events targeted to
// windows of type WINDOW_TYPE_CONTROL. This is important because the web
// contents are often (but not always) of type WINDOW_TYPE_CONTROL.
-TEST_P(SystemGestureEventFilterTest,
+TEST_F(SystemGestureEventFilterTest,
ControlWindowGetsMultiFingerGestureEvents) {
scoped_ptr<aura::Window> parent(
CreateTestWindowInShellWithBounds(gfx::Rect(100, 100)));
@@ -611,10 +599,5 @@ TEST_P(SystemGestureEventFilterTest,
aura::Env::GetInstance()->RemovePreTargetHandler(&event_handler);
}
-// Tests run twice - with docked windows disabled or enabled.
-INSTANTIATE_TEST_CASE_P(DockedWindowsDisabledOrEnabled,
- SystemGestureEventFilterTest,
- testing::Bool());
-
} // namespace test
} // namespace ash
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index def6ee8..c82acf2 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -9,7 +9,6 @@
#include <utility>
#include <vector>
-#include "ash/ash_switches.h"
#include "ash/display/display_controller.h"
#include "ash/metrics/user_metrics_recorder.h"
#include "ash/root_window_controller.h"
@@ -95,7 +94,7 @@ scoped_ptr<WindowResizer> CreateWindowResizer(
window_resizer = DragWindowResizer::Create(window_resizer, window_state);
if (window->type() == ui::wm::WINDOW_TYPE_PANEL)
window_resizer = PanelWindowResizer::Create(window_resizer, window_state);
- if (switches::UseDockedWindows() && window_resizer && window->parent() &&
+ if (window_resizer && window->parent() &&
!::wm::GetTransientParent(window) &&
(window->parent()->id() == kShellWindowId_DefaultContainer ||
window->parent()->id() == kShellWindowId_DockedContainer ||
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc
index 791e843..9fae0c9 100644
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -4,8 +4,6 @@
#include "ash/wm/workspace/workspace_window_resizer.h"
-#include "ash/ash_constants.h"
-#include "ash/ash_switches.h"
#include "ash/display/display_manager.h"
#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
@@ -1477,10 +1475,7 @@ TEST_F(WorkspaceWindowResizerTest, PhantomSnapMaxSize) {
scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
window_.get(), gfx::Point(), HTCAPTION));
resizer->Drag(CalculateDragPoint(*resizer, 801, 0), 0);
- if (switches::UseDockedWindows())
- EXPECT_TRUE(snap_phantom_window_controller());
- else
- EXPECT_FALSE(snap_phantom_window_controller());
+ EXPECT_TRUE(snap_phantom_window_controller());
resizer->RevertDrag();
}
{
diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc
index 7621b28..fcfa414 100644
--- a/ash/wm/workspace_controller_unittest.cc
+++ b/ash/wm/workspace_controller_unittest.cc
@@ -6,7 +6,6 @@
#include <map>
-#include "ash/ash_switches.h"
#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
#include "ash/shelf/shelf_layout_manager.h"
@@ -21,7 +20,6 @@
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace/workspace_window_resizer.h"
-#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/test/event_generator.h"
@@ -1375,24 +1373,11 @@ namespace {
// Subclass of WorkspaceControllerTest that runs tests with docked windows
// enabled and disabled.
-class WorkspaceControllerTestDragging
- : public WorkspaceControllerTest,
- public testing::WithParamInterface<bool> {
+class WorkspaceControllerTestDragging : public WorkspaceControllerTest {
public:
WorkspaceControllerTestDragging() {}
virtual ~WorkspaceControllerTestDragging() {}
- // testing::Test:
- virtual void SetUp() OVERRIDE {
- WorkspaceControllerTest::SetUp();
- if (!docked_windows_enabled()) {
- CommandLine::ForCurrentProcess()->AppendSwitch(
- ash::switches::kAshDisableDockedWindows);
- }
- }
-
- bool docked_windows_enabled() const { return GetParam(); }
-
private:
DISALLOW_COPY_AND_ASSIGN(WorkspaceControllerTestDragging);
};
@@ -1401,7 +1386,7 @@ class WorkspaceControllerTestDragging
// Verifies that when dragging a window over the shelf overlap is detected
// during and after the drag.
-TEST_P(WorkspaceControllerTestDragging, DragWindowOverlapShelf) {
+TEST_F(WorkspaceControllerTestDragging, DragWindowOverlapShelf) {
aura::test::TestWindowDelegate delegate;
delegate.set_window_component(HTCAPTION);
scoped_ptr<Window> w1(aura::test::CreateTestWindowWithDelegate(
@@ -1431,7 +1416,7 @@ TEST_P(WorkspaceControllerTestDragging, DragWindowOverlapShelf) {
// Verifies that when dragging a window autohidden shelf stays hidden during
// and after the drag.
-TEST_P(WorkspaceControllerTestDragging, DragWindowKeepsShelfAutohidden) {
+TEST_F(WorkspaceControllerTestDragging, DragWindowKeepsShelfAutohidden) {
aura::test::TestWindowDelegate delegate;
delegate.set_window_component(HTCAPTION);
scoped_ptr<Window> w1(aura::test::CreateTestWindowWithDelegate(
@@ -1455,9 +1440,6 @@ TEST_P(WorkspaceControllerTestDragging, DragWindowKeepsShelfAutohidden) {
EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
}
-INSTANTIATE_TEST_CASE_P(DockedOrNot, WorkspaceControllerTestDragging,
- ::testing::Bool());
-
// Verifies that events are targeted properly just outside the window edges.
TEST_F(WorkspaceControllerTest, WindowEdgeHitTest) {
aura::test::TestWindowDelegate d_first, d_second;
@@ -1586,8 +1568,6 @@ TEST_F(WorkspaceControllerTest, WindowEdgeTouchHitTestPanel) {
// Verifies events targeting just outside the window edges for docked windows.
TEST_F(WorkspaceControllerTest, WindowEdgeHitTestDocked) {
- if (!switches::UseDockedWindows())
- return;
aura::test::TestWindowDelegate delegate;
// Make window smaller than the minimum docked area so that the window edges
// are exposed.