OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ | 5 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
6 #define VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ | 6 #define VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 namespace gfx { | 9 namespace gfx { |
10 class Canvas; | 10 class Canvas; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const gfx::Rect& dirty_region) = 0; | 43 const gfx::Rect& dirty_region) = 0; |
44 | 44 |
45 // Paints the rootview in the canvas. This will also refresh the compositor | 45 // Paints the rootview in the canvas. This will also refresh the compositor |
46 // tree if necessary when accelerated painting is enabled. | 46 // tree if necessary when accelerated painting is enabled. |
47 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) = 0; | 47 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) = 0; |
48 | 48 |
49 // Mouse and key event handlers. | 49 // Mouse and key event handlers. |
50 virtual bool OnKeyEvent(const KeyEvent& event) = 0; | 50 virtual bool OnKeyEvent(const KeyEvent& event) = 0; |
51 virtual bool OnMouseEvent(const MouseEvent& event) = 0; | 51 virtual bool OnMouseEvent(const MouseEvent& event) = 0; |
52 virtual void OnMouseCaptureLost() = 0; | 52 virtual void OnMouseCaptureLost() = 0; |
| 53 |
| 54 // |
| 55 virtual Widget* AsWidget() = 0; |
| 56 virtual const Widget* AsWidget() const = 0; |
53 }; | 57 }; |
54 | 58 |
55 } // namespace internal | 59 } // namespace internal |
56 } // namespace views | 60 } // namespace views |
57 | 61 |
58 #endif // VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ | 62 #endif // VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
OLD | NEW |