| 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 #ifndef UI_AURA_ROOT_WINDOW_HOST_H_ | 5 #ifndef UI_AURA_ROOT_WINDOW_HOST_H_ |
| 6 #define UI_AURA_ROOT_WINDOW_HOST_H_ | 6 #define UI_AURA_ROOT_WINDOW_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "ui/base/cursor/cursor.h" | 10 #include "ui/base/cursor/cursor.h" |
| 11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
| 12 | 12 |
| 13 namespace gfx { | 13 namespace gfx { |
| 14 class Point; | 14 class Point; |
| 15 class Rect; | 15 class Rect; |
| 16 class Size; | 16 class Size; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace aura { | 19 namespace aura { |
| 20 | 20 |
| 21 class MouseEvent; |
| 21 class RootWindow; | 22 class RootWindow; |
| 22 | 23 |
| 23 // RootWindowHost bridges between a native window and the embedded RootWindow. | 24 // RootWindowHost bridges between a native window and the embedded RootWindow. |
| 24 // It provides the accelerated widget and maps events from the native os to | 25 // It provides the accelerated widget and maps events from the native os to |
| 25 // aura. | 26 // aura. |
| 26 class RootWindowHost { | 27 class RootWindowHost { |
| 27 public: | 28 public: |
| 28 virtual ~RootWindowHost() {} | 29 virtual ~RootWindowHost() {} |
| 29 | 30 |
| 30 // Creates a new RootWindowHost. The caller owns the returned value. | 31 // Creates a new RootWindowHost. The caller owns the returned value. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // Moves the cursor to the specified location relative to the root window. | 86 // Moves the cursor to the specified location relative to the root window. |
| 86 virtual void MoveCursorTo(const gfx::Point& location) = 0; | 87 virtual void MoveCursorTo(const gfx::Point& location) = 0; |
| 87 | 88 |
| 88 // Sets if the window should be focused when shown. | 89 // Sets if the window should be focused when shown. |
| 89 virtual void SetFocusWhenShown(bool focus_when_shown) = 0; | 90 virtual void SetFocusWhenShown(bool focus_when_shown) = 0; |
| 90 | 91 |
| 91 // Posts |native_event| to the platform's event queue. | 92 // Posts |native_event| to the platform's event queue. |
| 92 #if !defined(OS_MACOSX) | 93 #if !defined(OS_MACOSX) |
| 93 virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0; | 94 virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0; |
| 94 #endif | 95 #endif |
| 96 |
| 97 // Used to enable or disable the native window borders on a window. |
| 98 virtual void SetUseOSWindowBorders(bool use_os_borders) = 0; |
| 99 |
| 100 // Signal to the OS that it should start acting as if we're dragging the |
| 101 // window, either for movement or resizing. Returns true if we need to stop |
| 102 // event propagation. |
| 103 virtual bool DispatchWindowDragMovement(int hittest, |
| 104 MouseEvent* event) = 0; |
| 95 }; | 105 }; |
| 96 | 106 |
| 97 } // namespace aura | 107 } // namespace aura |
| 98 | 108 |
| 99 #endif // UI_AURA_ROOT_WINDOW_HOST_H_ | 109 #endif // UI_AURA_ROOT_WINDOW_HOST_H_ |
| OLD | NEW |