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 class Size; |
17 } | 18 } |
18 | 19 |
19 namespace aura { | 20 namespace aura { |
20 | 21 |
21 class Event; | 22 class Event; |
22 class KeyEvent; | 23 class KeyEvent; |
23 class MouseEvent; | 24 class MouseEvent; |
24 class TouchEvent; | 25 class TouchEvent; |
25 | 26 |
26 // Delegate interface for aura::Window. | 27 // Delegate interface for aura::Window. |
27 class AURA_EXPORT WindowDelegate { | 28 class AURA_EXPORT WindowDelegate { |
28 public: | 29 public: |
29 // Called before the Window's position and/or size changes and deleage could | 30 // Returns the window's minimum size, or size 0,0 if there is no limit. |
30 // take this opportunity to examine and change the new bounds. | 31 virtual gfx::Size GetMinimumSize() const = 0; |
31 virtual void OnBoundsChanging(gfx::Rect* new_bounds) = 0; | |
32 | 32 |
33 // Called when the Window's position and/or size changes. | 33 // Called when the Window's position and/or size changes. |
34 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, | 34 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
35 const gfx::Rect& new_bounds) = 0; | 35 const gfx::Rect& new_bounds) = 0; |
36 | 36 |
37 // 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. |
38 virtual void OnFocus() = 0; | 38 virtual void OnFocus() = 0; |
39 virtual void OnBlur() = 0; | 39 virtual void OnBlur() = 0; |
40 | 40 |
41 virtual bool OnKeyEvent(KeyEvent* event) = 0; | 41 virtual bool OnKeyEvent(KeyEvent* event) = 0; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Called when the visibility of a Window changed. | 83 // Called when the visibility of a Window changed. |
84 virtual void OnWindowVisibilityChanged(bool visible) = 0; | 84 virtual void OnWindowVisibilityChanged(bool visible) = 0; |
85 | 85 |
86 protected: | 86 protected: |
87 virtual ~WindowDelegate() {} | 87 virtual ~WindowDelegate() {} |
88 }; | 88 }; |
89 | 89 |
90 } // namespace aura | 90 } // namespace aura |
91 | 91 |
92 #endif // UI_AURA_WINDOW_DELEGATE_H_ | 92 #endif // UI_AURA_WINDOW_DELEGATE_H_ |
OLD | NEW |