summaryrefslogtreecommitdiffstats
path: root/ui/wm/public
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-07 13:36:31 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-07 13:36:31 +0000
commitf562a36006fc9e1c74c18c5c13fa594d93fadffd (patch)
tree5d4a5f0da3f3f47ddb52b361e9c072554e3bd455 /ui/wm/public
parentc5be8d67a355904dd9e9904b5f5943283a8dfe4f (diff)
downloadchromium_src-f562a36006fc9e1c74c18c5c13fa594d93fadffd.zip
chromium_src-f562a36006fc9e1c74c18c5c13fa594d93fadffd.tar.gz
chromium_src-f562a36006fc9e1c74c18c5c13fa594d93fadffd.tar.bz2
aura: Add a window-targeter for windows with hit-test masks.
Use the masked-window targeter for the touch-selection handlers. Subsequent patches will install similar targeters for the other windows that use hit-test masks, which will allow getting rid of some hit-test mask related API from aura and views. BUG=318879 R=ben@chromium.org Review URL: https://codereview.chromium.org/122573005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243287 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/wm/public')
-rw-r--r--ui/wm/public/masked_window_targeter.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/ui/wm/public/masked_window_targeter.h b/ui/wm/public/masked_window_targeter.h
new file mode 100644
index 0000000..c5b4d88
--- /dev/null
+++ b/ui/wm/public/masked_window_targeter.h
@@ -0,0 +1,38 @@
+// 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_MASKED_WINDOW_TARGETER_H_
+#define UI_WM_PUBLIC_MASKED_WINDOW_TARGETER_H_
+
+#include "ui/aura/window_targeter.h"
+
+namespace gfx {
+class Path;
+}
+
+namespace wm {
+
+class MaskedWindowTargeter : public aura::WindowTargeter {
+ public:
+ explicit MaskedWindowTargeter(aura::Window* masked_window);
+ virtual ~MaskedWindowTargeter();
+
+ protected:
+ // Sets the hit-test mask for |window| in |mask| (in |window|'s local
+ // coordinate system).
+ virtual void GetHitTestMask(aura::Window* window, gfx::Path* mask) const = 0;
+
+ // aura::WindowTargeter:
+ virtual bool EventLocationInsideBounds(
+ aura::Window* window,
+ const ui::LocatedEvent& event) const OVERRIDE;
+
+ aura::Window* masked_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(MaskedWindowTargeter);
+};
+
+} // namespace wm
+
+#endif // UI_WM_PUBLIC_MASKED_WINDOW_TARGETER_H_