summaryrefslogtreecommitdiffstats
path: root/ui/wm/public/masked_window_targeter.h
diff options
context:
space:
mode:
Diffstat (limited to 'ui/wm/public/masked_window_targeter.h')
-rw-r--r--ui/wm/public/masked_window_targeter.h39
1 files changed, 39 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..ad3140d3
--- /dev/null
+++ b/ui/wm/public/masked_window_targeter.h
@@ -0,0 +1,39 @@
+// 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). Returns whether a valid mask has been set in |mask|.
+ virtual bool GetHitTestMask(aura::Window* window, gfx::Path* mask) const = 0;
+
+ // aura::WindowTargeter:
+ virtual bool EventLocationInsideBounds(
+ aura::Window* window,
+ const ui::LocatedEvent& event) const OVERRIDE;
+
+ private:
+ aura::Window* masked_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(MaskedWindowTargeter);
+};
+
+} // namespace wm
+
+#endif // UI_WM_PUBLIC_MASKED_WINDOW_TARGETER_H_