Update V8 to version 4.7.57.
[chromium-blink-merge.git] / ui / views / widget / desktop_aura / x11_topmost_window_finder.h
blob5e3567a75283df63acd21ddfd4c70f2aa6f40e4e
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_TOPMOST_WINDOW_FINDER_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_TOPMOST_WINDOW_FINDER_H_
8 #include <set>
10 #include "ui/base/x/x11_util.h"
11 #include "ui/gfx/geometry/point.h"
12 #include "ui/views/views_export.h"
14 namespace aura {
15 class Window;
18 namespace views {
20 // Utility class for finding the topmost window at a given screen position.
21 class VIEWS_EXPORT X11TopmostWindowFinder
22 : public ui::EnumerateWindowsDelegate {
23 public:
24 X11TopmostWindowFinder();
25 ~X11TopmostWindowFinder() override;
27 // Returns the topmost window at |screen_loc_in_pixels|, ignoring the windows
28 // in |ignore|. Returns NULL if the topmost window at |screen_loc_in_pixels|
29 // does not belong to Chrome.
30 aura::Window* FindLocalProcessWindowAt(const gfx::Point& screen_loc_in_pixels,
31 const std::set<aura::Window*>& ignore);
33 // Returns the topmost window at |screen_loc_in_pixels|.
34 XID FindWindowAt(const gfx::Point& screen_loc_in_pixels);
36 private:
37 // ui::EnumerateWindowsDelegate:
38 bool ShouldStopIterating(XID xid) override;
40 // Returns true if |window| does not not belong to |ignore|, is visible and
41 // contains |screen_loc_|.
42 bool ShouldStopIteratingAtLocalProcessWindow(aura::Window* window);
44 gfx::Point screen_loc_in_pixels_;
45 std::set<aura::Window*> ignore_;
46 XID toplevel_;
48 DISALLOW_COPY_AND_ASSIGN(X11TopmostWindowFinder);
51 } // namespace
53 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_TOPMOST_WINDOW_FINDER_H_