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 "ui/aura/root_window.h" | 7 #include "ui/aura/root_window.h" |
8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
9 #include "ui/gfx/compositor/layer.h" | 9 #include "ui/gfx/compositor/layer.h" |
10 | 10 |
11 // DockInfo ------------------------------------------------------------------- | 11 // DockInfo ------------------------------------------------------------------- |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 aura::Window* GetLocalProcessWindowAtPointImpl( | 15 aura::Window* GetLocalProcessWindowAtPointImpl( |
16 const gfx::Point& screen_point, | 16 const gfx::Point& screen_point, |
17 const std::set<gfx::NativeView>& ignore, | 17 const std::set<gfx::NativeView>& ignore, |
18 aura::Window* window) { | 18 aura::Window* window) { |
19 if (ignore.find(window) != ignore.end()) | 19 if (ignore.find(window) != ignore.end()) |
20 return NULL; | 20 return NULL; |
21 | 21 |
22 if (!window->IsVisible()) | 22 if (!window->IsVisible()) |
23 return NULL; | 23 return NULL; |
24 | 24 |
25 if (window->layer()->type() == ui::Layer::LAYER_HAS_TEXTURE) { | 25 if (window->layer()->type() == ui::Layer::LAYER_TEXTURED) { |
26 gfx::Point window_point(screen_point); | 26 gfx::Point window_point(screen_point); |
27 aura::Window::ConvertPointToWindow(aura::RootWindow::GetInstance(), window, | 27 aura::Window::ConvertPointToWindow(aura::RootWindow::GetInstance(), window, |
28 &window_point); | 28 &window_point); |
29 return gfx::Rect(window->bounds().size()).Contains(window_point) ? | 29 return gfx::Rect(window->bounds().size()).Contains(window_point) ? |
30 window : NULL; | 30 window : NULL; |
31 } | 31 } |
32 for (aura::Window::Windows::const_reverse_iterator i = | 32 for (aura::Window::Windows::const_reverse_iterator i = |
33 window->children().rbegin(); i != window->children().rend(); ++i) { | 33 window->children().rbegin(); i != window->children().rend(); ++i) { |
34 aura::Window* result = | 34 aura::Window* result = |
35 GetLocalProcessWindowAtPointImpl(screen_point, ignore, *i); | 35 GetLocalProcessWindowAtPointImpl(screen_point, ignore, *i); |
(...skipping 24 matching lines...) Expand all Loading... |
60 bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const { | 60 bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const { |
61 if (!window()) | 61 if (!window()) |
62 return false; | 62 return false; |
63 *bounds = window_->bounds(); | 63 *bounds = window_->bounds(); |
64 return true; | 64 return true; |
65 } | 65 } |
66 | 66 |
67 void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const { | 67 void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const { |
68 window_->SetBounds(bounds); | 68 window_->SetBounds(bounds); |
69 } | 69 } |
OLD | NEW |