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

Unified Diff: ash/wm/window_resizer.h

Issue 15008002: Make touch-resizing windows to screen edge possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adjust unit tests with final behavior Created 7 years, 6 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/toplevel_window_event_handler.cc ('k') | ash/wm/window_resizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_resizer.h
diff --git a/ash/wm/window_resizer.h b/ash/wm/window_resizer.h
index bc46df85e31a51b9adb9d2932678303db03eee87..02d3b3cdcebfb31ef5e297eea76e6949f2baf021 100644
--- a/ash/wm/window_resizer.h
+++ b/ash/wm/window_resizer.h
@@ -8,6 +8,7 @@
#include "ash/ash_export.h"
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "ui/aura/client/window_move_client.h"
#include "ui/gfx/rect.h"
namespace aura {
@@ -56,7 +57,8 @@ class ASH_EXPORT WindowResizer {
Details();
Details(aura::Window* window,
const gfx::Point& location,
- int window_component);
+ int window_component,
+ aura::client::WindowMoveSource source);
~Details();
// The window we're resizing.
@@ -89,6 +91,9 @@ class ASH_EXPORT WindowResizer {
// Will the drag actually modify the window?
bool is_resizable;
+
+ // Source of the event initiating the drag.
+ aura::client::WindowMoveSource source;
};
static gfx::Rect CalculateBoundsForDrag(const Details& details,
@@ -100,6 +105,12 @@ class ASH_EXPORT WindowResizer {
static bool IsBottomEdge(int component);
private:
+ // In case of touch resizing, adjusts deltas so that the border is positioned
+ // just under the touch point.
+ static void AdjustDeltaForTouchResize(const Details& details,
+ int* delta_x,
+ int* delta_y);
+
// Returns the new origin of the window. The arguments are the difference
// between the current location and the initial location.
static gfx::Point GetOriginForDrag(const Details& details,
@@ -127,7 +138,8 @@ class ASH_EXPORT WindowResizer {
ASH_EXPORT scoped_ptr<WindowResizer> CreateWindowResizer(
aura::Window* window,
const gfx::Point& point_in_parent,
- int window_component);
+ int window_component,
+ aura::client::WindowMoveSource source);
} // namespace aura
« no previous file with comments | « ash/wm/toplevel_window_event_handler.cc ('k') | ash/wm/window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698