| 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 "ash/shell_window_ids.h" | 7 #include "ash/shell_window_ids.h" |
| 8 #include "ash/wm/coordinate_conversion.h" | 8 #include "ash/wm/coordinate_conversion.h" |
| 9 #include "ui/aura/client/screen_position_client.h" | 9 #include "ui/aura/client/screen_position_client.h" |
| 10 #include "ui/aura/root_window.h" | 10 #include "ui/aura/root_window.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 aura::Window* window) { | 21 aura::Window* window) { |
| 22 if (ignore.find(window) != ignore.end()) | 22 if (ignore.find(window) != ignore.end()) |
| 23 return NULL; | 23 return NULL; |
| 24 | 24 |
| 25 if (!window->IsVisible()) | 25 if (!window->IsVisible()) |
| 26 return NULL; | 26 return NULL; |
| 27 | 27 |
| 28 if (window->id() == ash::internal::kShellWindowId_PhantomWindow) | 28 if (window->id() == ash::internal::kShellWindowId_PhantomWindow) |
| 29 return NULL; | 29 return NULL; |
| 30 | 30 |
| 31 if (window->layer()->type() == ui::LAYER_TEXTURED) { | 31 if (window->layer()->type() == ui::LAYER_TEXTURED) |
| 32 gfx::Point window_point(screen_point); | 32 return window->GetBoundsInScreen().Contains(screen_point) ? window : NULL; |
| 33 aura::client::GetScreenPositionClient(window->GetRootWindow())-> | 33 |
| 34 ConvertPointFromScreen(window, &window_point); | |
| 35 return gfx::Rect(window->bounds().size()).Contains(window_point) ? | |
| 36 window : NULL; | |
| 37 } | |
| 38 for (aura::Window::Windows::const_reverse_iterator i = | 34 for (aura::Window::Windows::const_reverse_iterator i = |
| 39 window->children().rbegin(); i != window->children().rend(); ++i) { | 35 window->children().rbegin(); i != window->children().rend(); ++i) { |
| 40 aura::Window* result = | 36 aura::Window* result = |
| 41 GetLocalProcessWindowAtPointImpl(screen_point, ignore, *i); | 37 GetLocalProcessWindowAtPointImpl(screen_point, ignore, *i); |
| 42 if (result) | 38 if (result) |
| 43 return result; | 39 return result; |
| 44 } | 40 } |
| 45 return NULL; | 41 return NULL; |
| 46 } | 42 } |
| 47 | 43 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 66 bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const { | 62 bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const { |
| 67 if (!window()) | 63 if (!window()) |
| 68 return false; | 64 return false; |
| 69 *bounds = window_->bounds(); | 65 *bounds = window_->bounds(); |
| 70 return true; | 66 return true; |
| 71 } | 67 } |
| 72 | 68 |
| 73 void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const { | 69 void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const { |
| 74 window_->SetBounds(bounds); | 70 window_->SetBounds(bounds); |
| 75 } | 71 } |
| OLD | NEW |