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 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/aura/aura_export.h" | 9 #include "ui/aura/aura_export.h" |
10 #include "ui/base/events.h" | 10 #include "ui/base/events.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 Canvas; | 14 class Canvas; |
15 class Point; | 15 class Point; |
16 class Rect; | 16 class Rect; |
17 } | 17 } |
18 | 18 |
19 namespace aura { | 19 namespace aura { |
20 | 20 |
21 class Event; | 21 class Event; |
22 class KeyEvent; | 22 class KeyEvent; |
23 class MouseEvent; | 23 class MouseEvent; |
24 class TouchEvent; | 24 class TouchEvent; |
25 | 25 |
26 // Delegate interface for aura::Window. | 26 // Delegate interface for aura::Window. |
27 class AURA_EXPORT WindowDelegate { | 27 class AURA_EXPORT WindowDelegate { |
28 public: | 28 public: |
| 29 // Called before the Window's position and/or size changes and deleage could |
| 30 // take this opportunity to examine and change the new bounds. |
| 31 virtual void OnBoundsChanging(gfx::Rect* new_bounds) = 0; |
| 32 |
29 // Called when the Window's position and/or size changes. | 33 // Called when the Window's position and/or size changes. |
30 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, | 34 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
31 const gfx::Rect& new_bounds) = 0; | 35 const gfx::Rect& new_bounds) = 0; |
32 | 36 |
33 // Sent to the Window's delegate when the Window gains or loses focus. | 37 // Sent to the Window's delegate when the Window gains or loses focus. |
34 virtual void OnFocus() = 0; | 38 virtual void OnFocus() = 0; |
35 virtual void OnBlur() = 0; | 39 virtual void OnBlur() = 0; |
36 | 40 |
37 virtual bool OnKeyEvent(KeyEvent* event) = 0; | 41 virtual bool OnKeyEvent(KeyEvent* event) = 0; |
38 | 42 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // Called when the visibility of a Window changed. | 83 // Called when the visibility of a Window changed. |
80 virtual void OnWindowVisibilityChanged(bool visible) = 0; | 84 virtual void OnWindowVisibilityChanged(bool visible) = 0; |
81 | 85 |
82 protected: | 86 protected: |
83 virtual ~WindowDelegate() {} | 87 virtual ~WindowDelegate() {} |
84 }; | 88 }; |
85 | 89 |
86 } // namespace aura | 90 } // namespace aura |
87 | 91 |
88 #endif // UI_AURA_WINDOW_DELEGATE_H_ | 92 #endif // UI_AURA_WINDOW_DELEGATE_H_ |
OLD | NEW |