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_WIN_HWND_MESSAGE_HANDLER_DELEGATE_H_ | 5 #ifndef UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_DELEGATE_H_ |
6 #define UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_DELEGATE_H_ | 6 #define UI_VIEWS_WIN_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 { | 10 namespace gfx { |
(...skipping 19 matching lines...) Expand all Loading... |
30 virtual bool IsUsingCustomFrame() const = 0; | 30 virtual bool IsUsingCustomFrame() const = 0; |
31 | 31 |
32 virtual void SchedulePaint() = 0; | 32 virtual void SchedulePaint() = 0; |
33 virtual void EnableInactiveRendering() = 0; | 33 virtual void EnableInactiveRendering() = 0; |
34 virtual bool IsInactiveRenderingDisabled() = 0; | 34 virtual bool IsInactiveRenderingDisabled() = 0; |
35 | 35 |
36 virtual bool CanResize() const = 0; | 36 virtual bool CanResize() const = 0; |
37 virtual bool CanMaximize() const = 0; | 37 virtual bool CanMaximize() const = 0; |
38 virtual bool CanActivate() const = 0; | 38 virtual bool CanActivate() const = 0; |
39 | 39 |
| 40 // Returns true if the delegate has a focus saving mechanism that should be |
| 41 // used when the window is activated and deactivated. |
| 42 virtual bool CanSaveFocus() const = 0; |
| 43 virtual void SaveFocusOnDeactivate() = 0; |
| 44 virtual void RestoreFocusOnActivate() = 0; |
| 45 virtual void RestoreFocusOnEnable() = 0; |
| 46 |
| 47 // Returns true if the delegate represents a modal window. |
| 48 virtual bool IsModal() const = 0; |
| 49 |
| 50 // Returns the show state that should be used for the application's first |
| 51 // window. |
| 52 virtual int GetInitialShowState() const = 0; |
| 53 |
40 virtual bool WillProcessWorkAreaChange() const = 0; | 54 virtual bool WillProcessWorkAreaChange() const = 0; |
41 | 55 |
42 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; | 56 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; |
43 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* mask) = 0; | 57 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* mask) = 0; |
44 | 58 |
45 // Returns true if the delegate modifies |insets| to define a custom client | 59 // Returns true if the delegate modifies |insets| to define a custom client |
46 // area for the window, false if the default client area should be used. If | 60 // area for the window, false if the default client area should be used. If |
47 // false is returned, |insets| is not modified. | 61 // false is returned, |insets| is not modified. |
48 virtual bool GetClientAreaInsets(gfx::Insets* insets) const = 0; | 62 virtual bool GetClientAreaInsets(gfx::Insets* insets) const = 0; |
49 | 63 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Called when a command defined by the application was performed. Returns | 101 // Called when a command defined by the application was performed. Returns |
88 // true if the command was handled. | 102 // true if the command was handled. |
89 virtual bool HandleCommand(int command) = 0; | 103 virtual bool HandleCommand(int command) = 0; |
90 | 104 |
91 // Called when an accelerator is invoked. | 105 // Called when an accelerator is invoked. |
92 virtual void HandleAccelerator(const ui::Accelerator& accelerator) = 0; | 106 virtual void HandleAccelerator(const ui::Accelerator& accelerator) = 0; |
93 | 107 |
94 // Called when the HWND is created. | 108 // Called when the HWND is created. |
95 virtual void HandleCreate() = 0; | 109 virtual void HandleCreate() = 0; |
96 | 110 |
97 // Called when the HWND is destroyed. | 111 // Called when the HWND is being destroyed, before any child HWNDs are |
98 virtual void HandleDestroy() = 0; | 112 // destroyed. |
| 113 virtual void HandleDestroying() = 0; |
| 114 |
| 115 // Called after the HWND is destroyed, after all child HWNDs have been |
| 116 // destroyed. |
| 117 virtual void HandleDestroyed() = 0; |
| 118 |
| 119 // Called when the HWND is to be focused for the first time. This is called |
| 120 // when the window is shown for the first time. Returns true if the delegate |
| 121 // set focus and no default processing should be done by the message handler. |
| 122 virtual bool HandleInitialFocus() = 0; |
99 | 123 |
100 // Called when display settings are adjusted on the system. | 124 // Called when display settings are adjusted on the system. |
101 virtual void HandleDisplayChange() = 0; | 125 virtual void HandleDisplayChange() = 0; |
102 | 126 |
103 // Called when the system changes from glass to non-glass or vice versa. | 127 // Called when the system changes from glass to non-glass or vice versa. |
104 virtual void HandleGlassModeChange() = 0; | 128 virtual void HandleGlassModeChange() = 0; |
105 | 129 |
106 // Called when the user begins or ends a size/move operation using the window | 130 // Called when the user begins or ends a size/move operation using the window |
107 // manager. | 131 // manager. |
108 virtual void HandleBeginWMSizeMove() = 0; | 132 virtual void HandleBeginWMSizeMove() = 0; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // TODO(beng): should be removed once HWNDMessageHandler is the WindowImpl. | 183 // TODO(beng): should be removed once HWNDMessageHandler is the WindowImpl. |
160 virtual NativeWidgetWin* AsNativeWidgetWin() = 0; | 184 virtual NativeWidgetWin* AsNativeWidgetWin() = 0; |
161 | 185 |
162 protected: | 186 protected: |
163 virtual ~HWNDMessageHandlerDelegate() {} | 187 virtual ~HWNDMessageHandlerDelegate() {} |
164 }; | 188 }; |
165 | 189 |
166 } // namespace views | 190 } // namespace views |
167 | 191 |
168 #endif // UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_DELEGATE_H_ | 192 #endif // UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_DELEGATE_H_ |
OLD | NEW |