OLD | NEW |
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 #include "chrome/browser/ui/views/tabs/window_finder.h" | 5 #include "chrome/browser/ui/views/tabs/window_finder.h" |
6 | 6 |
7 #include "base/win/scoped_gdi_object.h" | 7 #include "base/win/scoped_gdi_object.h" |
8 #include "base/win/windows_version.h" | 8 #include "base/win/windows_version.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/gfx/screen.h" | 10 #include "ui/gfx/screen.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 public: | 65 public: |
66 // Returns true if |window| is the topmost window at the location | 66 // Returns true if |window| is the topmost window at the location |
67 // |screen_loc|, not including the windows in |ignore|. | 67 // |screen_loc|, not including the windows in |ignore|. |
68 static bool IsTopMostWindowAtPoint(HWND window, | 68 static bool IsTopMostWindowAtPoint(HWND window, |
69 const gfx::Point& screen_loc, | 69 const gfx::Point& screen_loc, |
70 const std::set<HWND>& ignore) { | 70 const std::set<HWND>& ignore) { |
71 TopMostFinder finder(window, screen_loc, ignore); | 71 TopMostFinder finder(window, screen_loc, ignore); |
72 return finder.is_top_most_; | 72 return finder.is_top_most_; |
73 } | 73 } |
74 | 74 |
75 virtual bool ShouldStopIterating(HWND hwnd) { | 75 bool ShouldStopIterating(HWND hwnd) override { |
76 if (hwnd == target_) { | 76 if (hwnd == target_) { |
77 // Window is topmost, stop iterating. | 77 // Window is topmost, stop iterating. |
78 is_top_most_ = true; | 78 is_top_most_ = true; |
79 return true; | 79 return true; |
80 } | 80 } |
81 | 81 |
82 if (!IsWindowVisible(hwnd)) { | 82 if (!IsWindowVisible(hwnd)) { |
83 // The window isn't visible, keep iterating. | 83 // The window isn't visible, keep iterating. |
84 return false; | 84 return false; |
85 } | 85 } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 TopMostFinder::IsTopMostWindowAtPoint(finder.result_, | 169 TopMostFinder::IsTopMostWindowAtPoint(finder.result_, |
170 screen_loc, | 170 screen_loc, |
171 ignore))) { | 171 ignore))) { |
172 return views::DesktopWindowTreeHostWin::GetContentWindowForHWND( | 172 return views::DesktopWindowTreeHostWin::GetContentWindowForHWND( |
173 finder.result_); | 173 finder.result_); |
174 } | 174 } |
175 return NULL; | 175 return NULL; |
176 } | 176 } |
177 | 177 |
178 protected: | 178 protected: |
179 virtual bool ShouldStopIterating(HWND hwnd) { | 179 bool ShouldStopIterating(HWND hwnd) override { |
180 RECT r; | 180 RECT r; |
181 if (IsWindowVisible(hwnd) && GetWindowRect(hwnd, &r) && | 181 if (IsWindowVisible(hwnd) && GetWindowRect(hwnd, &r) && |
182 PtInRect(&r, screen_loc_.ToPOINT())) { | 182 PtInRect(&r, screen_loc_.ToPOINT())) { |
183 result_ = hwnd; | 183 result_ = hwnd; |
184 return true; | 184 return true; |
185 } | 185 } |
186 return false; | 186 return false; |
187 } | 187 } |
188 | 188 |
189 private: | 189 private: |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 chrome::HostDesktopType host_desktop_type, | 222 chrome::HostDesktopType host_desktop_type, |
223 const gfx::Point& screen_point, | 223 const gfx::Point& screen_point, |
224 const std::set<gfx::NativeWindow>& ignore) { | 224 const std::set<gfx::NativeWindow>& ignore) { |
225 #if defined(USE_ASH) | 225 #if defined(USE_ASH) |
226 if (host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH) | 226 if (host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH) |
227 return GetLocalProcessWindowAtPointAsh(screen_point, ignore); | 227 return GetLocalProcessWindowAtPointAsh(screen_point, ignore); |
228 #endif | 228 #endif |
229 return LocalProcessWindowFinder::GetProcessWindowAtPoint( | 229 return LocalProcessWindowFinder::GetProcessWindowAtPoint( |
230 screen_point, RemapIgnoreSet(ignore)); | 230 screen_point, RemapIgnoreSet(ignore)); |
231 } | 231 } |
OLD | NEW |