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

Unified Diff: ash/wm/overview/overview_window_targeter.h

Issue 810033010: Remove TransparentActivateWindowButton from Overview Mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits Created 5 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 | « ash/wm/overview/overview_window_button.cc ('k') | ash/wm/overview/overview_window_targeter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/overview/overview_window_targeter.h
diff --git a/ash/wm/overview/overview_window_targeter.h b/ash/wm/overview/overview_window_targeter.h
new file mode 100644
index 0000000000000000000000000000000000000000..e60017c8a070317da62cfd0547b8b778300afab1
--- /dev/null
+++ b/ash/wm/overview/overview_window_targeter.h
@@ -0,0 +1,45 @@
+// Copyright 2015 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 ASH_WM_OVERVIEW_OVERVIEW_WINDOW_TARGETER_H_
+#define ASH_WM_OVERVIEW_OVERVIEW_WINDOW_TARGETER_H_
+
+#include "ui/aura/window_targeter.h"
+#include "ui/gfx/geometry/rect.h"
+
+namespace ash {
+
+// A targeter for the windows in the overview. Avoids propagating events to
+// window children and uses the WindowSelectorItem bounds to check for hits.
+class OverviewWindowTargeter : public aura::WindowTargeter {
+ public:
+ explicit OverviewWindowTargeter(aura::Window* target);
+
+ ~OverviewWindowTargeter() override;
+
+ // Sets the targetable bounds.
+ void set_bounds(const gfx::Rect& bounds) { bounds_ = bounds; }
+
+ // ui::EventTargeter:
+ ui::EventTarget* FindTargetForLocatedEvent(ui::EventTarget* target,
+ ui::LocatedEvent* event) override;
+
+ protected:
+ // ui::EventTargeter:
+ bool EventLocationInsideBounds(ui::EventTarget* target,
+ const ui::LocatedEvent& event) const override;
+
+ private:
+ // Bounds used to check for event hits in the root window coordinates.
+ gfx::Rect bounds_;
+
+ // Target to which events are redirected.
+ aura::Window* target_;
+
+ DISALLOW_COPY_AND_ASSIGN(OverviewWindowTargeter);
+};
+
+} // namespace ash
+
+#endif // ASH_WM_OVERVIEW_OVERVIEW_WINDOW_TARGETER_H_
« no previous file with comments | « ash/wm/overview/overview_window_button.cc ('k') | ash/wm/overview/overview_window_targeter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698