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 <shobjidl.h> | |
8 | |
9 #include "base/win/scoped_gdi_object.h" | 7 #include "base/win/scoped_gdi_object.h" |
10 #include "base/win/windows_version.h" | 8 #include "base/win/windows_version.h" |
11 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
12 #include "ui/gfx/screen.h" | 10 #include "ui/gfx/screen.h" |
13 #include "ui/gfx/win/dpi.h" | 11 #include "ui/gfx/win/dpi.h" |
14 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h" | 12 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h" |
15 #include "ui/views/win/hwnd_util.h" | 13 #include "ui/views/win/hwnd_util.h" |
16 | 14 |
17 #if defined(USE_ASH) | 15 #if defined(USE_ASH) |
18 gfx::NativeWindow GetLocalProcessWindowAtPointAsh( | 16 gfx::NativeWindow GetLocalProcessWindowAtPointAsh( |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // in ShouldStopIterating if target_ is passed in. | 143 // in ShouldStopIterating if target_ is passed in. |
146 bool is_top_most_; | 144 bool is_top_most_; |
147 | 145 |
148 base::win::ScopedRegion tmp_region_; | 146 base::win::ScopedRegion tmp_region_; |
149 | 147 |
150 DISALLOW_COPY_AND_ASSIGN(TopMostFinder); | 148 DISALLOW_COPY_AND_ASSIGN(TopMostFinder); |
151 }; | 149 }; |
152 | 150 |
153 // LocalProcessWindowFinder --------------------------------------------------- | 151 // LocalProcessWindowFinder --------------------------------------------------- |
154 | 152 |
| 153 // Copied from ShObjIdl.h in 10.0.10240.0 SDK. This can be removed once we |
| 154 // update to the newer SDK. |
| 155 #if NTDDI_VERSION < 0x0A000000 |
| 156 class DECLSPEC_UUID("aa509086-5ca9-4c25-8f95-589d3c07b48a") |
| 157 VirtualDesktopManager; |
| 158 |
| 159 MIDL_INTERFACE("a5cd92ff-29be-454c-8d04-d82879fb3f1b") |
| 160 IVirtualDesktopManager : public IUnknown { |
| 161 public: |
| 162 virtual HRESULT STDMETHODCALLTYPE IsWindowOnCurrentVirtualDesktop( |
| 163 /* [in] */ __RPC__in HWND topLevelWindow, |
| 164 /* [out] */ __RPC__out BOOL * onCurrentDesktop) = 0; |
| 165 |
| 166 virtual HRESULT STDMETHODCALLTYPE GetWindowDesktopId( |
| 167 /* [in] */ __RPC__in HWND topLevelWindow, |
| 168 /* [out] */ __RPC__out GUID * desktopId) = 0; |
| 169 |
| 170 virtual HRESULT STDMETHODCALLTYPE MoveWindowToDesktop( |
| 171 /* [in] */ __RPC__in HWND topLevelWindow, |
| 172 /* [in] */ __RPC__in REFGUID desktopId) = 0; |
| 173 }; |
| 174 #endif // NTDDI_VERSION < 0x0A000000 |
| 175 |
155 // Helper class to determine if a particular point contains a window from our | 176 // Helper class to determine if a particular point contains a window from our |
156 // process. | 177 // process. |
157 class LocalProcessWindowFinder : public BaseWindowFinder { | 178 class LocalProcessWindowFinder : public BaseWindowFinder { |
158 public: | 179 public: |
159 // Returns the hwnd from our process at screen_loc that is not obscured by | 180 // Returns the hwnd from our process at screen_loc that is not obscured by |
160 // another window. Returns NULL otherwise. | 181 // another window. Returns NULL otherwise. |
161 static gfx::NativeWindow GetProcessWindowAtPoint( | 182 static gfx::NativeWindow GetProcessWindowAtPoint( |
162 const gfx::Point& screen_loc, | 183 const gfx::Point& screen_loc, |
163 const std::set<HWND>& ignore) { | 184 const std::set<HWND>& ignore) { |
164 LocalProcessWindowFinder finder(screen_loc, ignore); | 185 LocalProcessWindowFinder finder(screen_loc, ignore); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 chrome::HostDesktopType host_desktop_type, | 263 chrome::HostDesktopType host_desktop_type, |
243 const gfx::Point& screen_point, | 264 const gfx::Point& screen_point, |
244 const std::set<gfx::NativeWindow>& ignore) { | 265 const std::set<gfx::NativeWindow>& ignore) { |
245 #if defined(USE_ASH) | 266 #if defined(USE_ASH) |
246 if (host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH) | 267 if (host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH) |
247 return GetLocalProcessWindowAtPointAsh(screen_point, ignore); | 268 return GetLocalProcessWindowAtPointAsh(screen_point, ignore); |
248 #endif | 269 #endif |
249 return LocalProcessWindowFinder::GetProcessWindowAtPoint( | 270 return LocalProcessWindowFinder::GetProcessWindowAtPoint( |
250 screen_point, RemapIgnoreSet(ignore)); | 271 screen_point, RemapIgnoreSet(ignore)); |
251 } | 272 } |
OLD | NEW |