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_HWND_MESSAGE_HANDLER_DELEGATE_H_ | 5 #ifndef UI_VIEWS_WIDGET_HWND_MESSAGE_HANDLER_DELEGATE_H_ |
6 #define UI_VIEWS_WIDGET_HWND_MESSAGE_HANDLER_DELEGATE_H_ | 6 #define UI_VIEWS_WIDGET_HWND_MESSAGE_HANDLER_DELEGATE_H_ |
7 | 7 |
8 #include "ui/views/views_export.h" | 8 #include "ui/views/views_export.h" |
9 | 9 |
| 10 namespace gfx { |
| 11 class Path; |
| 12 class Point; |
| 13 class Size; |
| 14 } |
| 15 |
10 namespace views { | 16 namespace views { |
11 | 17 |
12 class InputMethod; | 18 class InputMethod; |
13 class NativeWidgetWin; | 19 class NativeWidgetWin; |
14 | 20 |
15 // Implemented by the object that uses the HWNDMessageHandler to handle | 21 // Implemented by the object that uses the HWNDMessageHandler to handle |
16 // notifications from the underlying HWND and service requests for data. | 22 // notifications from the underlying HWND and service requests for data. |
17 class VIEWS_EXPORT HWNDMessageHandlerDelegate { | 23 class VIEWS_EXPORT HWNDMessageHandlerDelegate { |
18 public: | 24 public: |
19 virtual bool IsWidgetWindow() const = 0; | 25 virtual bool IsWidgetWindow() const = 0; |
20 | 26 |
21 // TODO(beng): resolve this more satisfactorily vis-a-vis ShouldUseNativeFrame | 27 // TODO(beng): resolve this more satisfactorily vis-a-vis ShouldUseNativeFrame |
22 // to avoid confusion. | 28 // to avoid confusion. |
23 virtual bool IsUsingCustomFrame() const = 0; | 29 virtual bool IsUsingCustomFrame() const = 0; |
24 | 30 |
| 31 virtual bool CanResize() const = 0; |
| 32 virtual bool CanMaximize() const = 0; |
| 33 virtual bool CanActivate() const = 0; |
| 34 |
| 35 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; |
| 36 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* mask) = 0; |
| 37 |
25 virtual InputMethod* GetInputMethod() = 0; | 38 virtual InputMethod* GetInputMethod() = 0; |
26 | 39 |
27 // TODO(beng): Investigate migrating these methods to On* prefixes once | 40 // TODO(beng): Investigate migrating these methods to On* prefixes once |
28 // HWNDMessageHandler is the WindowImpl. | 41 // HWNDMessageHandler is the WindowImpl. |
29 | 42 |
30 // Called when another app was activated. | 43 // Called when another app was activated. |
31 virtual void HandleAppDeactivated() = 0; | 44 virtual void HandleAppDeactivated() = 0; |
32 | 45 |
33 // Called when a well known "app command" from the system was performed. | 46 // Called when a well known "app command" from the system was performed. |
34 // Returns true if the command was handled. | 47 // Returns true if the command was handled. |
(...skipping 19 matching lines...) Expand all Loading... |
54 virtual void HandleGlassModeChange() = 0; | 67 virtual void HandleGlassModeChange() = 0; |
55 | 68 |
56 // Called when the user begins or ends a size/move operation using the window | 69 // Called when the user begins or ends a size/move operation using the window |
57 // manager. | 70 // manager. |
58 virtual void HandleBeginWMSizeMove() = 0; | 71 virtual void HandleBeginWMSizeMove() = 0; |
59 virtual void HandleEndWMSizeMove() = 0; | 72 virtual void HandleEndWMSizeMove() = 0; |
60 | 73 |
61 // Called when the window's position changed. | 74 // Called when the window's position changed. |
62 virtual void HandleMove() = 0; | 75 virtual void HandleMove() = 0; |
63 | 76 |
| 77 // Called when focus shifted to this HWND from |last_focused_window|. |
| 78 virtual void HandleNativeFocus(HWND last_focused_window) = 0; |
| 79 |
| 80 // Called when focus shifted from the HWND to a different window. |
| 81 virtual void HandleNativeBlur(HWND focused_window) = 0; |
| 82 |
64 // This is provided for methods that need to call private methods on NWW. | 83 // This is provided for methods that need to call private methods on NWW. |
65 // TODO(beng): should be removed once HWNDMessageHandler is the WindowImpl. | 84 // TODO(beng): should be removed once HWNDMessageHandler is the WindowImpl. |
66 virtual NativeWidgetWin* AsNativeWidgetWin() = 0; | 85 virtual NativeWidgetWin* AsNativeWidgetWin() = 0; |
67 | 86 |
68 protected: | 87 protected: |
69 virtual ~HWNDMessageHandlerDelegate() {} | 88 virtual ~HWNDMessageHandlerDelegate() {} |
70 }; | 89 }; |
71 | 90 |
72 } // namespace views | 91 } // namespace views |
73 | 92 |
74 #endif // UI_VIEWS_WIDGET_HWND_MESSAGE_HANDLER_DELEGATE_H_ | 93 #endif // UI_VIEWS_WIDGET_HWND_MESSAGE_HANDLER_DELEGATE_H_ |
OLD | NEW |