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

Unified Diff: ui/wm/public/easy_resize_window_targeter.h

Issue 118553004: aura: Add an EasyResizeWindowTargeter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r243131 Created 6 years, 11 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 | « ui/wm/core/easy_resize_window_targeter.cc ('k') | ui/wm/wm.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/public/easy_resize_window_targeter.h
diff --git a/ui/wm/public/easy_resize_window_targeter.h b/ui/wm/public/easy_resize_window_targeter.h
new file mode 100644
index 0000000000000000000000000000000000000000..c4c7137abd3808680334f256bb724f21442340b3
--- /dev/null
+++ b/ui/wm/public/easy_resize_window_targeter.h
@@ -0,0 +1,48 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_WM_PUBLIC_EASY_RESIZE_WINDOW_TARGETER_H_
+#define UI_WM_PUBLIC_EASY_RESIZE_WINDOW_TARGETER_H_
+
+#include "ui/aura/window_targeter.h"
+#include "ui/gfx/geometry/insets.h"
+
+namespace wm {
+
+// An EventTargeter for a container window that uses a slightly larger
+// hit-target region for easier resize.
+class EasyResizeWindowTargeter : public aura::WindowTargeter {
+ public:
+ // |container| window is the owner of this targeter.
+ EasyResizeWindowTargeter(aura::Window* container,
+ const gfx::Insets& mouse_extend,
+ const gfx::Insets& touch_extend);
+
+ virtual ~EasyResizeWindowTargeter();
+
+ protected:
+ void set_mouse_extend(const gfx::Insets& mouse_extend) {
+ mouse_extend_ = mouse_extend;
+ }
+
+ void set_touch_extend(const gfx::Insets& touch_extend) {
+ touch_extend_ = touch_extend;
+ }
+
+ // aura::WindowTargeter:
+ virtual bool EventLocationInsideBounds(
+ aura::Window* window,
+ const ui::LocatedEvent& event) const OVERRIDE;
+
+ private:
+ aura::Window* container_;
+ gfx::Insets mouse_extend_;
+ gfx::Insets touch_extend_;
+
+ DISALLOW_COPY_AND_ASSIGN(EasyResizeWindowTargeter);
+};
+
+} // namespace wm
+
+#endif // UI_WM_PUBLIC_EASY_RESIZE_WINDOW_TARGETER_H_
« no previous file with comments | « ui/wm/core/easy_resize_window_targeter.cc ('k') | ui/wm/wm.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698