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 VIEWS_WIDGET_NATIVE_WIDGET_H_ | 5 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_H_ |
6 #define VIEWS_WIDGET_NATIVE_WIDGET_H_ | 6 #define VIEWS_WIDGET_NATIVE_WIDGET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // a title bar. |app_icon| is a larger size for use in the host environment | 145 // a title bar. |app_icon| is a larger size for use in the host environment |
146 // app switching UI. | 146 // app switching UI. |
147 virtual void SetWindowIcons(const SkBitmap& window_icon, | 147 virtual void SetWindowIcons(const SkBitmap& window_icon, |
148 const SkBitmap& app_icon) = 0; | 148 const SkBitmap& app_icon) = 0; |
149 | 149 |
150 // Update native accessibility properties on the native window. | 150 // Update native accessibility properties on the native window. |
151 virtual void SetAccessibleName(const std::wstring& name) = 0; | 151 virtual void SetAccessibleName(const std::wstring& name) = 0; |
152 virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) = 0; | 152 virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) = 0; |
153 virtual void SetAccessibleState(ui::AccessibilityTypes::State state) = 0; | 153 virtual void SetAccessibleState(ui::AccessibilityTypes::State state) = 0; |
154 | 154 |
155 protected: | 155 enum ShowState { |
156 friend class Widget; | 156 SHOW_RESTORED, |
157 friend class NativeWidgetViews; | 157 SHOW_MAXIMIZED, |
| 158 SHOW_INACTIVE |
| 159 }; |
158 | 160 |
159 // Returns a handle for the underlying native widget that can be used for | 161 // Returns a handle for the underlying native widget that can be used for |
160 // accelerated drawing. | 162 // accelerated drawing. |
161 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; | 163 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; |
162 | 164 |
163 // Widget pass-thrus, private to Views. -------------------------------------- | 165 // Widget pass-thrus, private to Views. -------------------------------------- |
164 // See method documentation in Widget. | 166 // See method documentation in Widget. |
165 virtual gfx::Rect GetWindowScreenBounds() const = 0; | 167 virtual gfx::Rect GetWindowScreenBounds() const = 0; |
166 virtual gfx::Rect GetClientAreaScreenBounds() const = 0; | 168 virtual gfx::Rect GetClientAreaScreenBounds() const = 0; |
| 169 virtual gfx::Rect GetRestoredBounds() const = 0; |
167 virtual void SetBounds(const gfx::Rect& bounds) = 0; | 170 virtual void SetBounds(const gfx::Rect& bounds) = 0; |
168 virtual void SetSize(const gfx::Size& size) = 0; | 171 virtual void SetSize(const gfx::Size& size) = 0; |
169 virtual void SetBoundsConstrained(const gfx::Rect& bounds, | 172 virtual void SetBoundsConstrained(const gfx::Rect& bounds, |
170 Widget* other_widget) = 0; | 173 Widget* other_widget) = 0; |
171 virtual void MoveAbove(gfx::NativeView native_view) = 0; | 174 virtual void MoveAbove(gfx::NativeView native_view) = 0; |
172 virtual void SetShape(gfx::NativeRegion shape) = 0; | 175 virtual void SetShape(gfx::NativeRegion shape) = 0; |
173 virtual void Close() = 0; | 176 virtual void Close() = 0; |
174 virtual void CloseNow() = 0; | 177 virtual void CloseNow() = 0; |
| 178 virtual void EnableClose(bool enable) = 0; |
175 virtual void Show() = 0; | 179 virtual void Show() = 0; |
176 virtual void Hide() = 0; | 180 virtual void Hide() = 0; |
| 181 virtual void ShowNativeWidget(ShowState state) = 0; |
177 virtual bool IsVisible() const = 0; | 182 virtual bool IsVisible() const = 0; |
178 virtual void Activate() = 0; | 183 virtual void Activate() = 0; |
179 virtual void Deactivate() = 0; | 184 virtual void Deactivate() = 0; |
180 virtual bool IsActive() const = 0; | 185 virtual bool IsActive() const = 0; |
181 virtual void SetAlwaysOnTop(bool always_on_top) = 0; | 186 virtual void SetAlwaysOnTop(bool always_on_top) = 0; |
182 virtual void Maximize() = 0; | 187 virtual void Maximize() = 0; |
183 virtual void Minimize() = 0; | 188 virtual void Minimize() = 0; |
184 virtual bool IsMaximized() const = 0; | 189 virtual bool IsMaximized() const = 0; |
185 virtual bool IsMinimized() const = 0; | 190 virtual bool IsMinimized() const = 0; |
186 virtual void Restore() = 0; | 191 virtual void Restore() = 0; |
187 virtual void SetFullscreen(bool fullscreen) = 0; | 192 virtual void SetFullscreen(bool fullscreen) = 0; |
188 virtual bool IsFullscreen() const = 0; | 193 virtual bool IsFullscreen() const = 0; |
189 virtual void SetOpacity(unsigned char opacity) = 0; | 194 virtual void SetOpacity(unsigned char opacity) = 0; |
190 virtual void SetUseDragFrame(bool use_drag_frame) = 0; | 195 virtual void SetUseDragFrame(bool use_drag_frame) = 0; |
191 virtual bool IsAccessibleWidget() const = 0; | 196 virtual bool IsAccessibleWidget() const = 0; |
192 virtual bool ContainsNativeView(gfx::NativeView native_view) const = 0; | 197 virtual bool ContainsNativeView(gfx::NativeView native_view) const = 0; |
193 virtual void RunShellDrag(View* view, | 198 virtual void RunShellDrag(View* view, |
194 const ui::OSExchangeData& data, | 199 const ui::OSExchangeData& data, |
195 int operation) = 0; | 200 int operation) = 0; |
196 virtual void SchedulePaintInRect(const gfx::Rect& rect) = 0; | 201 virtual void SchedulePaintInRect(const gfx::Rect& rect) = 0; |
197 virtual void SetCursor(gfx::NativeCursor cursor) = 0; | 202 virtual void SetCursor(gfx::NativeCursor cursor) = 0; |
198 }; | 203 }; |
199 | 204 |
200 } // namespace views | 205 } // namespace views |
201 | 206 |
202 #endif // VIEWS_WIDGET_NATIVE_WIDGET_H_ | 207 #endif // VIEWS_WIDGET_NATIVE_WIDGET_H_ |
OLD | NEW |