| 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 "ash/shell.h" | 5 #include "ash/shell.h" |
| 6 #include "ash/shell_factory.h" | 6 #include "ash/shell_factory.h" |
| 7 #include "ash/wm/coordinate_conversion.h" | 7 #include "ash/wm/coordinate_conversion.h" |
| 8 #include "ash/wm/window_properties.h" | 8 #include "ash/wm/window_properties.h" |
| 9 #include "ui/aura/client/capture_client.h" | 9 #include "ui/aura/client/capture_client.h" |
| 10 #include "ui/aura/client/screen_position_client.h" | 10 #include "ui/aura/client/screen_position_client.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 DEFINE_OWNED_WINDOW_PROPERTY_KEY(UIControlsAura, kUIControlsKey, NULL); | 28 DEFINE_OWNED_WINDOW_PROPERTY_KEY(UIControlsAura, kUIControlsKey, NULL); |
| 29 | 29 |
| 30 // Returns the UIControls object for RootWindow. | 30 // Returns the UIControls object for RootWindow. |
| 31 // kUIControlsKey is owned property and UIControls object | 31 // kUIControlsKey is owned property and UIControls object |
| 32 // will be deleted when the root window is deleted. | 32 // will be deleted when the root window is deleted. |
| 33 UIControlsAura* GetUIControlsForRootWindow(aura::Window* root_window) { | 33 UIControlsAura* GetUIControlsForRootWindow(aura::Window* root_window) { |
| 34 UIControlsAura* native_ui_control = | 34 UIControlsAura* native_ui_control = |
| 35 root_window->GetProperty(kUIControlsKey); | 35 root_window->GetProperty(kUIControlsKey); |
| 36 if (!native_ui_control) { | 36 if (!native_ui_control) { |
| 37 native_ui_control = | 37 native_ui_control = |
| 38 aura::test::CreateUIControlsAura(root_window->GetDispatcher()); | 38 aura::test::CreateUIControlsAura(root_window->GetHost()->dispatcher()); |
| 39 // Pass the ownership to the |root_window|. | 39 // Pass the ownership to the |root_window|. |
| 40 root_window->SetProperty(kUIControlsKey, native_ui_control); | 40 root_window->SetProperty(kUIControlsKey, native_ui_control); |
| 41 } | 41 } |
| 42 return native_ui_control; | 42 return native_ui_control; |
| 43 } | 43 } |
| 44 | 44 |
| 45 // Returns the UIControls object for the RootWindow at |point_in_screen|. | 45 // Returns the UIControls object for the RootWindow at |point_in_screen|. |
| 46 UIControlsAura* GetUIControlsAt(const gfx::Point& point_in_screen) { | 46 UIControlsAura* GetUIControlsAt(const gfx::Point& point_in_screen) { |
| 47 // TODO(mazda): Support the case passive grab is taken. | 47 // TODO(mazda): Support the case passive grab is taken. |
| 48 return GetUIControlsForRootWindow(ash::wm::GetRootWindowAt(point_in_screen)); | 48 return GetUIControlsForRootWindow(ash::wm::GetRootWindowAt(point_in_screen)); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 private: | 130 private: |
| 131 DISALLOW_COPY_AND_ASSIGN(UIControlsAsh); | 131 DISALLOW_COPY_AND_ASSIGN(UIControlsAsh); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 ui_controls::UIControlsAura* CreateAshUIControls() { | 134 ui_controls::UIControlsAura* CreateAshUIControls() { |
| 135 return new ash::test::UIControlsAsh(); | 135 return new ash::test::UIControlsAsh(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace test | 138 } // namespace test |
| 139 } // namespace ash | 139 } // namespace ash |
| OLD | NEW |