Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6457)

Unified Diff: chrome/browser/ui/views/extensions/shell_window_views.cc

Issue 10854060: ash: Use different hit-test outer-region for mouse and touch events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: scale Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/shelf_layout_manager.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/extensions/shell_window_views.cc
diff --git a/chrome/browser/ui/views/extensions/shell_window_views.cc b/chrome/browser/ui/views/extensions/shell_window_views.cc
index b77ead603e9c4e90a404e184418e9b42fc623971..0f36e9fd210ef73519f56134c27908bd408521d4 100644
--- a/chrome/browser/ui/views/extensions/shell_window_views.cc
+++ b/chrome/browser/ui/views/extensions/shell_window_views.cc
@@ -37,6 +37,7 @@
#if defined(USE_ASH)
#include "ash/ash_constants.h"
#include "ash/wm/custom_frame_view_ash.h"
+#include "ui/aura/env.h"
#include "ui/aura/window.h"
#endif
@@ -121,12 +122,12 @@ void ShellWindowFrameView::Init(views::Widget* frame) {
#if defined(USE_ASH)
aura::Window* window = frame->GetNativeWindow();
// Ensure we get resize cursors for a few pixels outside our bounds.
- int outside_bounds = ui::GetDisplayLayout() == ui::LAYOUT_TOUCH ?
- ash::kResizeOutsideBoundsSizeTouch :
- ash::kResizeOutsideBoundsSize;
- window->set_hit_test_bounds_override_outer(
- gfx::Insets(-outside_bounds, -outside_bounds,
- -outside_bounds, -outside_bounds));
+ window->SetHitTestBoundsOverrideOuter(
+ gfx::Insets(-ash::kResizeOutsideBoundsSize,
+ -ash::kResizeOutsideBoundsSize,
+ -ash::kResizeOutsideBoundsSize,
+ -ash::kResizeOutsideBoundsSize),
+ ash::kResizeOutsideBoundsScaleForTouch);
// Ensure we get resize cursors just inside our bounds as well.
// TODO(jeremya): do we need to update these when in fullscreen/maximized?
window->set_hit_test_bounds_override_inner(
@@ -162,9 +163,11 @@ int ShellWindowFrameView::NonClientHitTest(const gfx::Point& point) {
#if defined(USE_ASH)
gfx::Rect expanded_bounds = bounds();
- int outside_bounds = ui::GetDisplayLayout() == ui::LAYOUT_TOUCH ?
- ash::kResizeOutsideBoundsSizeTouch :
- ash::kResizeOutsideBoundsSize;
+ int outside_bounds = ash::kResizeOutsideBoundsSize;
+ if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH &&
+ aura::Env::GetInstance()->is_touch_down()) {
+ outside_bounds *= ash::kResizeOutsideBoundsScaleForTouch;
+ }
expanded_bounds.Inset(-outside_bounds, -outside_bounds);
if (!expanded_bounds.Contains(point))
return HTNOWHERE;
« no previous file with comments | « ash/wm/shelf_layout_manager.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698