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

Side by Side Diff: ui/views/widget/desktop_aura/x11_topmost_window_finder.h

Issue 264713007: Add unittests for X11TopmostWindowFinder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_TOPMOST_WINDOW_FINDER_H_ 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_TOPMOST_WINDOW_FINDER_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_TOPMOST_WINDOW_FINDER_H_ 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_TOPMOST_WINDOW_FINDER_H_
7 7
8 #include <map>
8 #include <set> 9 #include <set>
9 10
10 #include "ui/base/x/x11_util.h" 11 #include "ui/base/x/x11_util.h"
11 #include "ui/gfx/point.h" 12 #include "ui/gfx/point.h"
12 #include "ui/views/views_export.h" 13 #include "ui/views/views_export.h"
13 14
14 namespace aura { 15 namespace aura {
15 class Window; 16 class Window;
16 } 17 }
17 18
(...skipping 12 matching lines...) Expand all
30 aura::Window* FindLocalProcessWindowAt(const gfx::Point& screen_loc, 31 aura::Window* FindLocalProcessWindowAt(const gfx::Point& screen_loc,
31 const std::set<aura::Window*>& ignore); 32 const std::set<aura::Window*>& ignore);
32 33
33 // Returns the topmost window at |screen_loc|. 34 // Returns the topmost window at |screen_loc|.
34 XID FindWindowAt(const gfx::Point& screen_loc); 35 XID FindWindowAt(const gfx::Point& screen_loc);
35 36
36 private: 37 private:
37 // ui::EnumerateWindowsDelegate: 38 // ui::EnumerateWindowsDelegate:
38 virtual bool ShouldStopIterating(XID xid) OVERRIDE; 39 virtual bool ShouldStopIterating(XID xid) OVERRIDE;
39 40
40 // Returns true if |window| does not not belong to |ignore|, is visible and 41 gfx::Point screen_loc_;
41 // contains |screen_loc_|. 42 XID toplevel_;
42 bool ShouldStopIteratingAtLocalProcessWindow(aura::Window* window);
43 43
44 gfx::Point screen_loc_; 44 // Cache of XID to whether the window contains |screen_loc_|. Used to avoid
45 std::set<aura::Window*> ignore_; 45 // querying a window's properties multiple times.
46 XID toplevel_; 46 std::map<XID, bool> cache_;
47 47
48 DISALLOW_COPY_AND_ASSIGN(X11TopmostWindowFinder); 48 DISALLOW_COPY_AND_ASSIGN(X11TopmostWindowFinder);
49 }; 49 };
50 50
51 } // namespace 51 } // namespace
52 52
53 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_TOPMOST_WINDOW_FINDER_H_ 53 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_TOPMOST_WINDOW_FINDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698