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