| 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_PRIVATE_H_ | 5 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_PRIVATE_H_ |
| 6 #define VIEWS_WIDGET_NATIVE_WIDGET_PRIVATE_H_ | 6 #define VIEWS_WIDGET_NATIVE_WIDGET_PRIVATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 #include "views/ime/input_method_delegate.h" | 10 #include "views/ime/input_method_delegate.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // Returns the InputMethod for this native widget. | 130 // Returns the InputMethod for this native widget. |
| 131 // Note that all widgets in a widget hierarchy share the same input method. | 131 // Note that all widgets in a widget hierarchy share the same input method. |
| 132 // TODO(suzhe): rename to GetInputMethod() when NativeWidget implementation | 132 // TODO(suzhe): rename to GetInputMethod() when NativeWidget implementation |
| 133 // class doesn't inherit Widget anymore. | 133 // class doesn't inherit Widget anymore. |
| 134 virtual InputMethod* CreateInputMethod() = 0; | 134 virtual InputMethod* CreateInputMethod() = 0; |
| 135 | 135 |
| 136 | 136 |
| 137 // Centers the window and sizes it to the specified size. | 137 // Centers the window and sizes it to the specified size. |
| 138 virtual void CenterWindow(const gfx::Size& size) = 0; | 138 virtual void CenterWindow(const gfx::Size& size) = 0; |
| 139 | 139 |
| 140 // Retrieves the window's current restored bounds and "show" state, for | 140 // Retrieves the window's current restored bounds and maximized state, for |
| 141 // persisting. | 141 // persisting. |
| 142 virtual void GetWindowPlacement( | 142 virtual void GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, |
| 143 gfx::Rect* bounds, | 143 bool* maximized) const = 0; |
| 144 ui::WindowShowState* show_state) const = 0; | |
| 145 | 144 |
| 146 // Sets the NativeWindow title. | 145 // Sets the NativeWindow title. |
| 147 virtual void SetWindowTitle(const std::wstring& title) = 0; | 146 virtual void SetWindowTitle(const std::wstring& title) = 0; |
| 148 | 147 |
| 149 // Sets the Window icons. |window_icon| is a 16x16 icon suitable for use in | 148 // Sets the Window icons. |window_icon| is a 16x16 icon suitable for use in |
| 150 // a title bar. |app_icon| is a larger size for use in the host environment | 149 // a title bar. |app_icon| is a larger size for use in the host environment |
| 151 // app switching UI. | 150 // app switching UI. |
| 152 virtual void SetWindowIcons(const SkBitmap& window_icon, | 151 virtual void SetWindowIcons(const SkBitmap& window_icon, |
| 153 const SkBitmap& app_icon) = 0; | 152 const SkBitmap& app_icon) = 0; |
| 154 | 153 |
| 155 // Update native accessibility properties on the native window. | 154 // Update native accessibility properties on the native window. |
| 156 virtual void SetAccessibleName(const std::wstring& name) = 0; | 155 virtual void SetAccessibleName(const std::wstring& name) = 0; |
| 157 virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) = 0; | 156 virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) = 0; |
| 158 virtual void SetAccessibleState(ui::AccessibilityTypes::State state) = 0; | 157 virtual void SetAccessibleState(ui::AccessibilityTypes::State state) = 0; |
| 159 | 158 |
| 159 enum ShowState { |
| 160 SHOW_RESTORED, |
| 161 SHOW_MAXIMIZED, |
| 162 SHOW_INACTIVE |
| 163 }; |
| 164 |
| 160 // Makes the NativeWindow modal. | 165 // Makes the NativeWindow modal. |
| 161 virtual void BecomeModal() = 0; | 166 virtual void BecomeModal() = 0; |
| 162 | 167 |
| 163 // See method documentation in Widget. | 168 // See method documentation in Widget. |
| 164 virtual gfx::Rect GetWindowScreenBounds() const = 0; | 169 virtual gfx::Rect GetWindowScreenBounds() const = 0; |
| 165 virtual gfx::Rect GetClientAreaScreenBounds() const = 0; | 170 virtual gfx::Rect GetClientAreaScreenBounds() const = 0; |
| 166 virtual gfx::Rect GetRestoredBounds() const = 0; | 171 virtual gfx::Rect GetRestoredBounds() const = 0; |
| 167 virtual void SetBounds(const gfx::Rect& bounds) = 0; | 172 virtual void SetBounds(const gfx::Rect& bounds) = 0; |
| 168 virtual void SetSize(const gfx::Size& size) = 0; | 173 virtual void SetSize(const gfx::Size& size) = 0; |
| 169 virtual void SetBoundsConstrained(const gfx::Rect& bounds, | 174 virtual void SetBoundsConstrained(const gfx::Rect& bounds, |
| 170 Widget* other_widget) = 0; | 175 Widget* other_widget) = 0; |
| 171 virtual void MoveAbove(gfx::NativeView native_view) = 0; | 176 virtual void MoveAbove(gfx::NativeView native_view) = 0; |
| 172 virtual void MoveToTop() = 0; | 177 virtual void MoveToTop() = 0; |
| 173 virtual void SetShape(gfx::NativeRegion shape) = 0; | 178 virtual void SetShape(gfx::NativeRegion shape) = 0; |
| 174 virtual void Close() = 0; | 179 virtual void Close() = 0; |
| 175 virtual void CloseNow() = 0; | 180 virtual void CloseNow() = 0; |
| 176 virtual void EnableClose(bool enable) = 0; | 181 virtual void EnableClose(bool enable) = 0; |
| 177 virtual void Show() = 0; | 182 virtual void Show() = 0; |
| 178 virtual void Hide() = 0; | 183 virtual void Hide() = 0; |
| 179 // Invoked if the initial show should maximize the window. |restored_bounds| | 184 // Invoked if the initial show should maximize the window. |restored_bounds| |
| 180 // is the bounds of the window when not maximized. | 185 // is the bounds of the window when not maximized. |
| 181 virtual void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) = 0; | 186 virtual void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) = 0; |
| 182 virtual void ShowWithWindowState(ui::WindowShowState show_state) = 0; | 187 virtual void ShowWithState(ShowState state) = 0; |
| 183 virtual bool IsVisible() const = 0; | 188 virtual bool IsVisible() const = 0; |
| 184 virtual void Activate() = 0; | 189 virtual void Activate() = 0; |
| 185 virtual void Deactivate() = 0; | 190 virtual void Deactivate() = 0; |
| 186 virtual bool IsActive() const = 0; | 191 virtual bool IsActive() const = 0; |
| 187 virtual void SetAlwaysOnTop(bool always_on_top) = 0; | 192 virtual void SetAlwaysOnTop(bool always_on_top) = 0; |
| 188 virtual void Maximize() = 0; | 193 virtual void Maximize() = 0; |
| 189 virtual void Minimize() = 0; | 194 virtual void Minimize() = 0; |
| 190 virtual bool IsMaximized() const = 0; | 195 virtual bool IsMaximized() const = 0; |
| 191 virtual bool IsMinimized() const = 0; | 196 virtual bool IsMinimized() const = 0; |
| 192 virtual void Restore() = 0; | 197 virtual void Restore() = 0; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 206 const Widget* ancestor, gfx::Point* point) const = 0; | 211 const Widget* ancestor, gfx::Point* point) const = 0; |
| 207 | 212 |
| 208 // Overridden from NativeWidget: | 213 // Overridden from NativeWidget: |
| 209 virtual internal::NativeWidgetPrivate* AsNativeWidgetPrivate() OVERRIDE; | 214 virtual internal::NativeWidgetPrivate* AsNativeWidgetPrivate() OVERRIDE; |
| 210 }; | 215 }; |
| 211 | 216 |
| 212 } // namespace internal | 217 } // namespace internal |
| 213 } // namespace views | 218 } // namespace views |
| 214 | 219 |
| 215 #endif // VIEWS_WIDGET_NATIVE_WIDGET_PRIVATE_H_ | 220 #endif // VIEWS_WIDGET_NATIVE_WIDGET_PRIVATE_H_ |
| OLD | NEW |