| 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_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ | 5 #ifndef UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
| 6 #define UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ | 6 #define UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <vector> | |
| 9 | |
| 10 #include "ui/events/event_constants.h" | 8 #include "ui/events/event_constants.h" |
| 9 #include "ui/gfx/native_widget_types.h" |
| 11 #include "ui/views/views_export.h" | 10 #include "ui/views/views_export.h" |
| 12 | 11 |
| 13 namespace gfx { | 12 namespace gfx { |
| 14 class Path; | 13 class Path; |
| 15 class Point; | 14 class Point; |
| 16 class Size; | 15 class Size; |
| 17 } | 16 } |
| 18 | 17 |
| 19 namespace ui { | 18 namespace ui { |
| 20 class GestureEvent; | 19 class GestureEvent; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // Event handlers. | 120 // Event handlers. |
| 122 virtual void OnKeyEvent(ui::KeyEvent* event) = 0; | 121 virtual void OnKeyEvent(ui::KeyEvent* event) = 0; |
| 123 virtual void OnMouseEvent(ui::MouseEvent* event) = 0; | 122 virtual void OnMouseEvent(ui::MouseEvent* event) = 0; |
| 124 virtual void OnMouseCaptureLost() = 0; | 123 virtual void OnMouseCaptureLost() = 0; |
| 125 virtual void OnScrollEvent(ui::ScrollEvent* event) = 0; | 124 virtual void OnScrollEvent(ui::ScrollEvent* event) = 0; |
| 126 virtual void OnGestureEvent(ui::GestureEvent* event) = 0; | 125 virtual void OnGestureEvent(ui::GestureEvent* event) = 0; |
| 127 | 126 |
| 128 // Runs the specified native command. Returns true if the command is handled. | 127 // Runs the specified native command. Returns true if the command is handled. |
| 129 virtual bool ExecuteCommand(int command_id) = 0; | 128 virtual bool ExecuteCommand(int command_id) = 0; |
| 130 | 129 |
| 131 // Returns the child Layers of the Widgets layer that were created by Views. | |
| 132 virtual const std::vector<ui::Layer*>& GetRootLayers() = 0; | |
| 133 | |
| 134 // Returns true if window has a hit-test mask. | 130 // Returns true if window has a hit-test mask. |
| 135 virtual bool HasHitTestMask() const = 0; | 131 virtual bool HasHitTestMask() const = 0; |
| 136 | 132 |
| 137 // Provides the hit-test mask if HasHitTestMask above returns true. | 133 // Provides the hit-test mask if HasHitTestMask above returns true. |
| 138 virtual void GetHitTestMask(gfx::Path* mask) const = 0; | 134 virtual void GetHitTestMask(gfx::Path* mask) const = 0; |
| 139 | 135 |
| 140 virtual Widget* AsWidget() = 0; | 136 virtual Widget* AsWidget() = 0; |
| 141 virtual const Widget* AsWidget() const = 0; | 137 virtual const Widget* AsWidget() const = 0; |
| 142 | 138 |
| 143 // Sets-up the focus manager with the view that should have focus when the | 139 // Sets-up the focus manager with the view that should have focus when the |
| 144 // window is shown the first time. It takes the intended |show_state| of the | 140 // window is shown the first time. It takes the intended |show_state| of the |
| 145 // window in order to decide whether the window should be focused now or | 141 // window in order to decide whether the window should be focused now or |
| 146 // later. Returns true if the initial focus has been set or the window should | 142 // later. Returns true if the initial focus has been set or the window should |
| 147 // not set the initial focus, or false if the caller should set the initial | 143 // not set the initial focus, or false if the caller should set the initial |
| 148 // focus (if any). | 144 // focus (if any). |
| 149 virtual bool SetInitialFocus(ui::WindowShowState show_state) = 0; | 145 virtual bool SetInitialFocus(ui::WindowShowState show_state) = 0; |
| 146 |
| 147 // Returns true if event handling should descend into |child|. |root_layer| is |
| 148 // the layer associated with the root Window and |child_layer| the layer |
| 149 // associated with |child|. |location| is in terms of the Window. |
| 150 virtual bool ShouldDescendIntoChildForEventHandling( |
| 151 ui::Layer* root_layer, |
| 152 gfx::NativeView child, |
| 153 ui::Layer* child_layer, |
| 154 const gfx::Point& location) = 0; |
| 150 }; | 155 }; |
| 151 | 156 |
| 152 } // namespace internal | 157 } // namespace internal |
| 153 } // namespace views | 158 } // namespace views |
| 154 | 159 |
| 155 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ | 160 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
| OLD | NEW |