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_WINDOW_DELEGATE_H_ | 5 #ifndef UI_AURA_WINDOW_DELEGATE_H_ |
6 #define UI_AURA_WINDOW_DELEGATE_H_ | 6 #define UI_AURA_WINDOW_DELEGATE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "ui/aura/aura_export.h" | 10 #include "ui/aura/aura_export.h" |
11 #include "ui/base/events/event_constants.h" | 11 #include "ui/base/events/event_constants.h" |
12 #include "ui/base/events/event_handler.h" | 12 #include "ui/base/events/event_handler.h" |
13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
14 | 14 |
15 namespace gfx { | 15 namespace gfx { |
16 class Canvas; | 16 class Canvas; |
17 class Path; | 17 class Path; |
18 class Point; | 18 class Point; |
19 class Rect; | 19 class Rect; |
20 class Size; | 20 class Size; |
21 } | 21 } |
22 | 22 |
23 namespace ui { | 23 namespace ui { |
24 class GestureEvent; | 24 class GestureEvent; |
25 class KeyEvent; | 25 class KeyEvent; |
| 26 class Layer; |
26 class MouseEvent; | 27 class MouseEvent; |
27 class Texture; | 28 class Texture; |
28 class TouchEvent; | 29 class TouchEvent; |
29 } | 30 } |
30 | 31 |
31 namespace aura { | 32 namespace aura { |
32 | 33 |
33 // Delegate interface for aura::Window. | 34 // Delegate interface for aura::Window. |
34 class AURA_EXPORT WindowDelegate : public ui::EventHandler { | 35 class AURA_EXPORT WindowDelegate : public ui::EventHandler { |
35 public: | 36 public: |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // Called from Window::HitTest to check if the window has a custom hit test | 89 // Called from Window::HitTest to check if the window has a custom hit test |
89 // mask. It works similar to the views counterparts. That is, if the function | 90 // mask. It works similar to the views counterparts. That is, if the function |
90 // returns true, GetHitTestMask below will be called to get the mask. | 91 // returns true, GetHitTestMask below will be called to get the mask. |
91 // Otherwise, Window will hit-test against its bounds. | 92 // Otherwise, Window will hit-test against its bounds. |
92 virtual bool HasHitTestMask() const = 0; | 93 virtual bool HasHitTestMask() const = 0; |
93 | 94 |
94 // Called from Window::HitTest to retrieve hit test mask when HasHitTestMask | 95 // Called from Window::HitTest to retrieve hit test mask when HasHitTestMask |
95 // above returns true. | 96 // above returns true. |
96 virtual void GetHitTestMask(gfx::Path* mask) const = 0; | 97 virtual void GetHitTestMask(gfx::Path* mask) const = 0; |
97 | 98 |
98 // Called from RecreateLayer() if the layer the window is associated with has | 99 // Called from RecreateLayer() after the new layer was created. old_layer is |
99 // an external texture. | 100 // the layer that will be returned to the caller of RecreateLayer, new_layer |
100 virtual scoped_refptr<ui::Texture> CopyTexture() = 0; | 101 // will be the layer now used on the Window. The implementation only has to do |
| 102 // anything if the layer has external content (SetExternalTexture / |
| 103 // SetTextureMailbox / SetDelegatedFrame was called). |
| 104 virtual void DidRecreateLayer(ui::Layer* old_layer, ui::Layer* new_layer) = 0; |
101 | 105 |
102 protected: | 106 protected: |
103 virtual ~WindowDelegate() {} | 107 virtual ~WindowDelegate() {} |
104 }; | 108 }; |
105 | 109 |
106 } // namespace aura | 110 } // namespace aura |
107 | 111 |
108 #endif // UI_AURA_WINDOW_DELEGATE_H_ | 112 #endif // UI_AURA_WINDOW_DELEGATE_H_ |
OLD | NEW |