summaryrefslogtreecommitdiffstats
path: root/ash/root_window_controller.cc
diff options
context:
space:
mode:
authortdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-17 05:20:39 +0000
committertdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-17 05:20:39 +0000
commitb8642ec4593f6daf22cd4c70d422f5cc40c16e7f (patch)
tree5302bf7dabae2b993be22842843fe0d7d0112783 /ash/root_window_controller.cc
parentd7cf7264b7844ba136eeca7dfe82c806c1c46a9c (diff)
downloadchromium_src-b8642ec4593f6daf22cd4c70d422f5cc40c16e7f.zip
chromium_src-b8642ec4593f6daf22cd4c70d422f5cc40c16e7f.tar.gz
chromium_src-b8642ec4593f6daf22cd4c70d422f5cc40c16e7f.tar.bz2
Disallow touch hit-testing along attached edges of panels
Introduce AttachedPanelWindowTargeter, a new derived class of EasyResizeWindowTargeter. When installed as the EventTargeter of a panel container, the extended touch hit-testing inset is set to 0 for the edges of panels adjacent to the shelf. This makes it significantly easier to correctly target shelf buttons with touch because shelf-adjacent edges of panels are prevented from themselves being targets. BUG=351348 TEST=WorkspaceControllerTest.WindowEdgeTouchHitTestPanel,PanelLayoutManagerTest.TouchHitTestPanel Review URL: https://codereview.chromium.org/232703006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264429 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/root_window_controller.cc')
-rw-r--r--ash/root_window_controller.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 3d4a839..6dd3b67 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -33,6 +33,7 @@
#include "ash/touch/touch_observer_hud.h"
#include "ash/wm/always_on_top_controller.h"
#include "ash/wm/dock/docked_window_layout_manager.h"
+#include "ash/wm/panels/attached_panel_window_targeter.h"
#include "ash/wm/panels/panel_layout_manager.h"
#include "ash/wm/panels/panel_window_event_handler.h"
#include "ash/wm/root_window_layout_manager.h"
@@ -415,6 +416,9 @@ void RootWindowController::OnShelfCreated() {
if (shelf_->shelf_layout_manager())
docked_layout_manager_->AddObserver(shelf_->shelf_layout_manager());
}
+
+ // Notify shell observers that the shelf has been created.
+ Shell::GetInstance()->OnShelfCreatedForRootWindow(GetRootWindow());
}
void RootWindowController::UpdateAfterLoginStatusChange(
@@ -785,6 +789,20 @@ void RootWindowController::InitLayoutManagers() {
panel_container->SetLayoutManager(panel_layout_manager_);
panel_container_handler_.reset(new PanelWindowEventHandler);
panel_container->AddPreTargetHandler(panel_container_handler_.get());
+
+ // Install an AttachedPanelWindowTargeter on the panel container to make it
+ // easier to correctly target shelf buttons with touch.
+ gfx::Insets mouse_extend(-kResizeOutsideBoundsSize,
+ -kResizeOutsideBoundsSize,
+ -kResizeOutsideBoundsSize,
+ -kResizeOutsideBoundsSize);
+ gfx::Insets touch_extend = mouse_extend.Scale(
+ kResizeOutsideBoundsScaleForTouch);
+ panel_container->SetEventTargeter(scoped_ptr<ui::EventTargeter>(
+ new AttachedPanelWindowTargeter(panel_container,
+ mouse_extend,
+ touch_extend,
+ panel_layout_manager_)));
}
void RootWindowController::InitTouchHuds() {
@@ -894,7 +912,6 @@ void RootWindowController::CreateContainersInRootWindow(
"PanelContainer",
non_lock_screen_containers);
SetUsesScreenCoordinates(panel_container);
- SetUsesEasyResizeTargeter(panel_container);
aura::Window* shelf_bubble_container =
CreateContainer(kShellWindowId_ShelfBubbleContainer,