summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-25 17:45:14 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-25 17:45:14 +0000
commitfd42270f7d1c9b6c560e69592075fe1fc880325c (patch)
treeab6d1c68b91d6ac79dbc3a4bfdab1ff142c5cc90
parent76cf9be18c6bfd30b8f3f64b286979f1ee02461f (diff)
downloadchromium_src-fd42270f7d1c9b6c560e69592075fe1fc880325c.zip
chromium_src-fd42270f7d1c9b6c560e69592075fe1fc880325c.tar.gz
chromium_src-fd42270f7d1c9b6c560e69592075fe1fc880325c.tar.bz2
ash: Disable tray-dragging by default.
BUG=152187, 146878 Review URL: https://codereview.chromium.org/10989019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158605 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/ash_switches.cc3
-rw-r--r--ash/ash_switches.h1
-rw-r--r--ash/wm/shelf_layout_manager.cc11
-rw-r--r--ash/wm/shelf_layout_manager_unittest.cc8
4 files changed, 22 insertions, 1 deletions
diff --git a/ash/ash_switches.cc b/ash/ash_switches.cc
index e4f2a34..4fd6389 100644
--- a/ash/ash_switches.cc
+++ b/ash/ash_switches.cc
@@ -31,6 +31,9 @@ const char kAshEnableAdvancedGestures[] = "ash-enable-advanced-gestures";
// Enables the Oak tree viewer.
const char kAshEnableOak[] = "ash-enable-oak";
+// Enables showing the tray bubble by dragging on the shelf.
+const char kAshEnableTrayDragging[] = "ash-enable-tray-dragging";
+
// Specifies the layout mode and offsets for the secondary display for
// testing. The format is "<t|r|b|l>,<offset>" where t=TOP, r=RIGHT,
// b=BOTTOM and L=LEFT. For example, 'r,-100' means the secondary display
diff --git a/ash/ash_switches.h b/ash/ash_switches.h
index 2b887f4..bca954c 100644
--- a/ash/ash_switches.h
+++ b/ash/ash_switches.h
@@ -23,6 +23,7 @@ ASH_EXPORT extern const char kAshDisableWorkspace2[];
ASH_EXPORT extern const char kAshDisableBootAnimation2[];
ASH_EXPORT extern const char kAshEnableAdvancedGestures[];
ASH_EXPORT extern const char kAshEnableOak[];
+ASH_EXPORT extern const char kAshEnableTrayDragging[];
ASH_EXPORT extern const char kAshSecondaryDisplayLayout[];
ASH_EXPORT extern const char kAshTouchHud[];
ASH_EXPORT extern const char kAshWindowAnimationsDisabled[];
diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc
index 757ba68..83184dc 100644
--- a/ash/wm/shelf_layout_manager.cc
+++ b/ash/wm/shelf_layout_manager.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <cmath>
+#include "ash/ash_switches.h"
#include "ash/launcher/launcher.h"
#include "ash/screen_ash.h"
#include "ash/shell.h"
@@ -16,6 +17,7 @@
#include "ash/wm/window_animations.h"
#include "ash/wm/workspace_controller.h"
#include "base/auto_reset.h"
+#include "base/command_line.h"
#include "base/i18n/rtl.h"
#include "ui/aura/client/activation_client.h"
#include "ui/aura/event_filter.h"
@@ -45,6 +47,12 @@ ui::Layer* GetLayer(views::Widget* widget) {
return widget->GetNativeView()->layer();
}
+bool IsDraggingTrayEnabled() {
+ static bool dragging_tray_allowed = CommandLine::ForCurrentProcess()->
+ HasSwitch(ash::switches::kAshEnableTrayDragging);
+ return dragging_tray_allowed;
+}
+
} // namespace
// static
@@ -368,7 +376,8 @@ ShelfLayoutManager::DragState ShelfLayoutManager::UpdateGestureDrag(
GetPreferredSize().height();
if (min_height < launcher_widget()->GetWindowBoundsInScreen().height() &&
- gesture.root_location().x() >= status_->GetWindowBoundsInScreen().x())
+ gesture.root_location().x() >= status_->GetWindowBoundsInScreen().x() &&
+ IsDraggingTrayEnabled())
return DRAG_TRAY;
}
diff --git a/ash/wm/shelf_layout_manager_unittest.cc b/ash/wm/shelf_layout_manager_unittest.cc
index dacc7617..0584729 100644
--- a/ash/wm/shelf_layout_manager_unittest.cc
+++ b/ash/wm/shelf_layout_manager_unittest.cc
@@ -6,6 +6,7 @@
#include "ash/accelerators/accelerator_controller.h"
#include "ash/accelerators/accelerator_table.h"
+#include "ash/ash_switches.h"
#include "ash/focus_cycler.h"
#include "ash/launcher/launcher.h"
#include "ash/screen_ash.h"
@@ -17,6 +18,7 @@
#include "ash/system/tray/system_tray_item.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/window_util.h"
+#include "base/command_line.h"
#include "base/utf_string_conversions.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
@@ -168,6 +170,12 @@ class ShelfLayoutManagerTest : public ash::test::AshTestBase {
return window;
}
+ // Overridden from AshTestBase:
+ virtual void SetUp() OVERRIDE {
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ ash::switches::kAshEnableTrayDragging);
+ test::AshTestBase::SetUp();
+ }
private:
DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManagerTest);
};