OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tabs/dock_info.h" | 5 #include "chrome/browser/ui/tabs/dock_info.h" |
6 | 6 |
7 #include "chrome/browser/ui/host_desktop.h" | 7 #include "chrome/browser/ui/host_desktop.h" |
8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #if defined(USE_X11) | |
10 #include "ui/base/x/x11_util.h" | 11 #include "ui/base/x/x11_util.h" |
11 | |
12 #if !defined(OS_CHROMEOS) | |
13 #include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h" | |
14 #endif | 12 #endif |
15 | 13 |
16 #if !defined(OS_CHROMEOS) | 14 #if !defined(OS_CHROMEOS) && defined(USE_X11) |
15 #include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h" | |
17 | 16 |
18 namespace { | 17 namespace { |
19 | 18 |
20 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
21 // BaseWindowFinder | 20 // BaseWindowFinder |
22 // | 21 // |
23 // Base class used to locate a window. A subclass need only override | 22 // Base class used to locate a window. A subclass need only override |
24 // ShouldStopIterating to determine when iteration should stop. | 23 // ShouldStopIterating to determine when iteration should stop. |
25 class BaseWindowFinder : public ui::EnumerateWindowsDelegate { | 24 class BaseWindowFinder : public ui::EnumerateWindowsDelegate { |
26 public: | 25 public: |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 // The resulting window. This is initially null but set to true in | 168 // The resulting window. This is initially null but set to true in |
170 // ShouldStopIterating if an appropriate window is found. | 169 // ShouldStopIterating if an appropriate window is found. |
171 XID result_; | 170 XID result_; |
172 | 171 |
173 DISALLOW_COPY_AND_ASSIGN(LocalProcessWindowFinder); | 172 DISALLOW_COPY_AND_ASSIGN(LocalProcessWindowFinder); |
174 }; | 173 }; |
175 | 174 |
176 } // namespace | 175 } // namespace |
177 | 176 |
178 // static | 177 // static |
178 gfx::NativeView DockInfo::GetLocalProcessWindowAtPoint( | |
179 chrome::HostDesktopType host_desktop_type, | |
180 const gfx::Point& screen_point, | |
181 const std::set<gfx::NativeView>& ignore) { | |
182 // The X11 server is the canonical state of what the window stacking order | |
183 // is. | |
184 XID xid = | |
185 LocalProcessWindowFinder::GetProcessWindowAtPoint(screen_point, ignore); | |
186 return views::DesktopRootWindowHostX11::GetContentWindowForXID(xid); | |
187 } | |
188 #endif | |
189 | |
190 // static | |
179 DockInfo DockInfo::GetDockInfoAtPoint(chrome::HostDesktopType host_desktop_type, | 191 DockInfo DockInfo::GetDockInfoAtPoint(chrome::HostDesktopType host_desktop_type, |
180 const gfx::Point& screen_point, | 192 const gfx::Point& screen_point, |
181 const std::set<gfx::NativeView>& ignore) { | 193 const std::set<gfx::NativeView>& ignore) { |
182 // TODO(beng): | 194 // TODO(beng): |
183 NOTIMPLEMENTED(); | 195 NOTIMPLEMENTED(); |
184 return DockInfo(); | 196 return DockInfo(); |
185 } | 197 } |
186 | 198 |
187 // static | 199 // static |
188 gfx::NativeView DockInfo::GetLocalProcessWindowAtPoint( | 200 gfx::NativeView DockInfo::GetLocalProcessWindowAtPoint( |
Ben Goodger (Google)
2013/10/23 17:39:28
shouldn't this be in #else?
vignatti (out of this project)
2013/10/24 07:46:20
yes, obviously!
| |
189 chrome::HostDesktopType host_desktop_type, | 201 chrome::HostDesktopType host_desktop_type, |
190 const gfx::Point& screen_point, | 202 const gfx::Point& screen_point, |
191 const std::set<gfx::NativeView>& ignore) { | 203 const std::set<gfx::NativeView>& ignore) { |
192 // The X11 server is the canonical state of what the window stacking order | 204 |
193 // is. | 205 // TODO(vignatti): |
194 XID xid = | 206 NOTIMPLEMENTED(); |
195 LocalProcessWindowFinder::GetProcessWindowAtPoint(screen_point, ignore); | 207 return NULL; |
196 return views::DesktopRootWindowHostX11::GetContentWindowForXID(xid); | |
197 } | 208 } |
198 | 209 |
199 bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const { | 210 bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const { |
200 if (!window()) | 211 if (!window()) |
201 return false; | 212 return false; |
202 *bounds = window_->bounds(); | 213 *bounds = window_->bounds(); |
203 return true; | 214 return true; |
204 } | 215 } |
205 | 216 |
206 void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const { | 217 void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const { |
207 window_->SetBounds(bounds); | 218 window_->SetBounds(bounds); |
208 } | 219 } |
209 | |
210 #endif | |
OLD | NEW |