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 "ui/views/widget/desktop_native_widget_helper_aura.h" | 5 #include "ui/views/widget/desktop_native_widget_helper_aura.h" |
6 | 6 |
7 #include "ui/aura/client/dispatcher_client.h" | 7 #include "ui/aura/client/dispatcher_client.h" |
8 #include "ui/aura/client/screen_position_client.h" | 8 #include "ui/aura/client/screen_position_client.h" |
9 #include "ui/aura/desktop/desktop_activation_client.h" | 9 #include "ui/aura/desktop/desktop_activation_client.h" |
10 #include "ui/aura/desktop/desktop_cursor_client.h" | 10 #include "ui/aura/desktop/desktop_cursor_client.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 virtual void ConvertPointFromScreen(const aura::Window* window, | 54 virtual void ConvertPointFromScreen(const aura::Window* window, |
55 gfx::Point* point) OVERRIDE { | 55 gfx::Point* point) OVERRIDE { |
56 const aura::RootWindow* root_window = window->GetRootWindow(); | 56 const aura::RootWindow* root_window = window->GetRootWindow(); |
57 gfx::Point origin = root_window->GetHostOrigin(); | 57 gfx::Point origin = root_window->GetHostOrigin(); |
58 point->Offset(-origin.x(), -origin.y()); | 58 point->Offset(-origin.x(), -origin.y()); |
59 aura::Window::ConvertPointToTarget(root_window, window, point); | 59 aura::Window::ConvertPointToTarget(root_window, window, point); |
60 } | 60 } |
61 | 61 |
62 virtual void SetBounds(aura::Window* window, | 62 virtual void SetBounds(aura::Window* window, |
63 const gfx::Rect& bounds) OVERRIDE { | 63 const gfx::Rect& bounds, |
| 64 const gfx::Display& display) OVERRIDE { |
| 65 // TODO: Use the 3rd parameter, |display|. |
64 gfx::Point origin = bounds.origin(); | 66 gfx::Point origin = bounds.origin(); |
65 aura::RootWindow* root = window->GetRootWindow(); | 67 aura::RootWindow* root = window->GetRootWindow(); |
66 aura::Window::ConvertPointToTarget(window->parent(), root, &origin); | 68 aura::Window::ConvertPointToTarget(window->parent(), root, &origin); |
67 | 69 |
68 #if !defined(OS_WIN) | 70 #if !defined(OS_WIN) |
69 if (window->type() == aura::client::WINDOW_TYPE_CONTROL) { | 71 if (window->type() == aura::client::WINDOW_TYPE_CONTROL) { |
70 window->SetBounds(gfx::Rect(origin, bounds.size())); | 72 window->SetBounds(gfx::Rect(origin, bounds.size())); |
71 return; | 73 return; |
72 } else if (window->type() == aura::client::WINDOW_TYPE_POPUP) { | 74 } else if (window->type() == aura::client::WINDOW_TYPE_POPUP) { |
73 // The caller expects windows we consider "embedded" to be placed in the | 75 // The caller expects windows we consider "embedded" to be placed in the |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 root->GetHostSize())); | 242 root->GetHostSize())); |
241 } | 243 } |
242 | 244 |
243 void DesktopNativeWidgetHelperAura::OnRootWindowHostClosed( | 245 void DesktopNativeWidgetHelperAura::OnRootWindowHostClosed( |
244 const aura::RootWindow* root) { | 246 const aura::RootWindow* root) { |
245 DCHECK_EQ(root, root_window_.get()); | 247 DCHECK_EQ(root, root_window_.get()); |
246 widget_->GetWidget()->Close(); | 248 widget_->GetWidget()->Close(); |
247 } | 249 } |
248 | 250 |
249 } // namespace views | 251 } // namespace views |
OLD | NEW |