| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/debug/trace_event.h" |
| 7 #include "chrome/browser/ui/host_desktop.h" | 8 #include "chrome/browser/ui/host_desktop.h" |
| 8 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
| 9 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| 10 #if defined(USE_X11) | 11 #if defined(USE_X11) |
| 11 #include "ui/base/x/x11_util.h" | 12 #include "ui/base/x/x11_util.h" |
| 12 #endif | 13 #endif |
| 13 | 14 |
| 14 #if !defined(OS_CHROMEOS) && defined(USE_X11) | 15 #if !defined(OS_CHROMEOS) && defined(USE_X11) |
| 15 #include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h" | 16 #include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h" |
| 16 | 17 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 DISALLOW_COPY_AND_ASSIGN(LocalProcessWindowFinder); | 173 DISALLOW_COPY_AND_ASSIGN(LocalProcessWindowFinder); |
| 173 }; | 174 }; |
| 174 | 175 |
| 175 } // namespace | 176 } // namespace |
| 176 | 177 |
| 177 // static | 178 // static |
| 178 gfx::NativeView DockInfo::GetLocalProcessWindowAtPoint( | 179 gfx::NativeView DockInfo::GetLocalProcessWindowAtPoint( |
| 179 chrome::HostDesktopType host_desktop_type, | 180 chrome::HostDesktopType host_desktop_type, |
| 180 const gfx::Point& screen_point, | 181 const gfx::Point& screen_point, |
| 181 const std::set<gfx::NativeView>& ignore) { | 182 const std::set<gfx::NativeView>& ignore) { |
| 183 TRACE_EVENT1("ui", "DockInfo::GetLocalProcessWindowAtPoint", |
| 184 "screen_point", screen_point.ToString()); |
| 185 |
| 182 // The X11 server is the canonical state of what the window stacking order | 186 // The X11 server is the canonical state of what the window stacking order |
| 183 // is. | 187 // is. |
| 184 XID xid = | 188 XID xid = |
| 185 LocalProcessWindowFinder::GetProcessWindowAtPoint(screen_point, ignore); | 189 LocalProcessWindowFinder::GetProcessWindowAtPoint(screen_point, ignore); |
| 186 return views::DesktopRootWindowHostX11::GetContentWindowForXID(xid); | 190 return views::DesktopRootWindowHostX11::GetContentWindowForXID(xid); |
| 187 } | 191 } |
| 188 #else | 192 #else |
| 189 // static | 193 // static |
| 190 gfx::NativeView DockInfo::GetLocalProcessWindowAtPoint( | 194 gfx::NativeView DockInfo::GetLocalProcessWindowAtPoint( |
| 191 chrome::HostDesktopType host_desktop_type, | 195 chrome::HostDesktopType host_desktop_type, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 210 bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const { | 214 bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const { |
| 211 if (!window()) | 215 if (!window()) |
| 212 return false; | 216 return false; |
| 213 *bounds = window_->bounds(); | 217 *bounds = window_->bounds(); |
| 214 return true; | 218 return true; |
| 215 } | 219 } |
| 216 | 220 |
| 217 void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const { | 221 void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const { |
| 218 window_->SetBounds(bounds); | 222 window_->SetBounds(bounds); |
| 219 } | 223 } |
| OLD | NEW |