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> | 8 #include <vector> |
9 | 9 |
10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
11 #include "ui/views/views_export.h" | 11 #include "ui/views/views_export.h" |
12 | 12 |
13 namespace gfx { | 13 namespace gfx { |
14 class Canvas; | 14 class Canvas; |
15 class Path; | 15 class Path; |
16 class Point; | 16 class Point; |
17 class Size; | 17 class Size; |
18 } | 18 } |
19 | 19 |
20 namespace ui { | 20 namespace ui { |
21 class GestureEvent; | 21 class GestureEvent; |
22 class KeyEvent; | 22 class KeyEvent; |
23 class Layer; | 23 class Layer; |
24 class MouseEvent; | 24 class MouseEvent; |
| 25 class PaintContext; |
| 26 class ScrollEvent; |
25 class TouchEvent; | 27 class TouchEvent; |
26 class ScrollEvent; | |
27 } | 28 } |
28 | 29 |
29 namespace views { | 30 namespace views { |
30 class InputMethod; | 31 class InputMethod; |
31 class Widget; | 32 class Widget; |
32 | 33 |
33 namespace internal { | 34 namespace internal { |
34 | 35 |
35 //////////////////////////////////////////////////////////////////////////////// | 36 //////////////////////////////////////////////////////////////////////////////// |
36 // NativeWidgetDelegate | 37 // NativeWidgetDelegate |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 virtual void OnNativeWidgetEndUserBoundsChange() = 0; | 104 virtual void OnNativeWidgetEndUserBoundsChange() = 0; |
104 | 105 |
105 // Returns true if the delegate has a FocusManager. | 106 // Returns true if the delegate has a FocusManager. |
106 virtual bool HasFocusManager() const = 0; | 107 virtual bool HasFocusManager() const = 0; |
107 | 108 |
108 // Paints the widget using acceleration. If the widget is not using | 109 // Paints the widget using acceleration. If the widget is not using |
109 // accelerated painting this returns false and does nothing. | 110 // accelerated painting this returns false and does nothing. |
110 virtual bool OnNativeWidgetPaintAccelerated( | 111 virtual bool OnNativeWidgetPaintAccelerated( |
111 const gfx::Rect& dirty_region) = 0; | 112 const gfx::Rect& dirty_region) = 0; |
112 | 113 |
113 // Paints the rootview in the canvas. This will also refresh the compositor | 114 // Paints the rootview in the context. This will also refresh the compositor |
114 // tree if necessary when accelerated painting is enabled. | 115 // tree if necessary. |
115 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) = 0; | 116 virtual void OnNativeWidgetPaint(const ui::PaintContext& context) = 0; |
116 | 117 |
117 // Returns the non-client component (see ui/base/hit_test.h) containing | 118 // Returns the non-client component (see ui/base/hit_test.h) containing |
118 // |point|, in client coordinates. | 119 // |point|, in client coordinates. |
119 virtual int GetNonClientComponent(const gfx::Point& point) = 0; | 120 virtual int GetNonClientComponent(const gfx::Point& point) = 0; |
120 | 121 |
121 // Mouse and key event handlers. | 122 // Mouse and key event handlers. |
122 virtual void OnKeyEvent(ui::KeyEvent* event) = 0; | 123 virtual void OnKeyEvent(ui::KeyEvent* event) = 0; |
123 virtual void OnMouseEvent(ui::MouseEvent* event) = 0; | 124 virtual void OnMouseEvent(ui::MouseEvent* event) = 0; |
124 virtual void OnMouseCaptureLost() = 0; | 125 virtual void OnMouseCaptureLost() = 0; |
125 | 126 |
(...skipping 27 matching lines...) Expand all Loading... |
153 // later. Returns true if the initial focus has been set or the window should | 154 // later. Returns true if the initial focus has been set or the window should |
154 // not set the initial focus, or false if the caller should set the initial | 155 // not set the initial focus, or false if the caller should set the initial |
155 // focus (if any). | 156 // focus (if any). |
156 virtual bool SetInitialFocus(ui::WindowShowState show_state) = 0; | 157 virtual bool SetInitialFocus(ui::WindowShowState show_state) = 0; |
157 }; | 158 }; |
158 | 159 |
159 } // namespace internal | 160 } // namespace internal |
160 } // namespace views | 161 } // namespace views |
161 | 162 |
162 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ | 163 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
OLD | NEW |