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_WIDGET_DELEGATE_H_ | 5 #ifndef VIEWS_WIDGET_WIDGET_DELEGATE_H_ |
6 #define VIEWS_WIDGET_WIDGET_DELEGATE_H_ | 6 #define VIEWS_WIDGET_WIDGET_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "ui/base/accessibility/accessibility_types.h" | 12 #include "ui/base/accessibility/accessibility_types.h" |
13 #include "ui/base/ui_base_types.h" | |
14 #include "views/view.h" | 13 #include "views/view.h" |
15 | 14 |
16 class SkBitmap; | 15 class SkBitmap; |
17 | 16 |
18 namespace gfx { | 17 namespace gfx { |
19 class Rect; | 18 class Rect; |
20 } | 19 } |
21 | 20 |
22 namespace views { | 21 namespace views { |
23 class ClientView; | 22 class ClientView; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 virtual bool ShouldShowWindowIcon() const; | 90 virtual bool ShouldShowWindowIcon() const; |
92 | 91 |
93 // Execute a command in the window's controller. Returns true if the command | 92 // Execute a command in the window's controller. Returns true if the command |
94 // was handled, false if it was not. | 93 // was handled, false if it was not. |
95 virtual bool ExecuteWindowsCommand(int command_id); | 94 virtual bool ExecuteWindowsCommand(int command_id); |
96 | 95 |
97 // Returns the window's name identifier. Used to identify this window for | 96 // Returns the window's name identifier. Used to identify this window for |
98 // state restoration. | 97 // state restoration. |
99 virtual std::wstring GetWindowName() const; | 98 virtual std::wstring GetWindowName() const; |
100 | 99 |
101 // Saves the window's bounds and "show" state. By default this uses the | 100 // Saves the window's bounds and maximized states. By default this uses the |
102 // process' local state keyed by window name (See GetWindowName above). This | 101 // process' local state keyed by window name (See GetWindowName above). This |
103 // behavior can be overridden to provide additional functionality. | 102 // behavior can be overridden to provide additional functionality. |
104 virtual void SaveWindowPlacement(const gfx::Rect& bounds, | 103 virtual void SaveWindowPlacement(const gfx::Rect& bounds, bool maximized); |
105 ui::WindowShowState show_state); | |
106 | 104 |
107 // Retrieves the window's bounds and "show" states. | 105 // Retrieves the window's bounds and maximized states. |
108 // This behavior can be overridden to provide additional functionality. | 106 // This behavior can be overridden to provide additional functionality. |
109 virtual bool GetSavedWindowPlacement(gfx::Rect* bounds, | 107 virtual bool GetSavedWindowBounds(gfx::Rect* bounds) const; |
110 ui::WindowShowState* show_state) const; | 108 virtual bool GetSavedMaximizedState(bool* maximized) const; |
111 | 109 |
112 // Returns true if the window's size should be restored. If this is false, | 110 // Returns true if the window's size should be restored. If this is false, |
113 // only the window's origin is restored and the window is given its | 111 // only the window's origin is restored and the window is given its |
114 // preferred size. | 112 // preferred size. |
115 // Default is true. | 113 // Default is true. |
116 virtual bool ShouldRestoreWindowSize() const; | 114 virtual bool ShouldRestoreWindowSize() const; |
117 | 115 |
118 // Called when the window closes. The delegate MUST NOT delete itself during | 116 // Called when the window closes. The delegate MUST NOT delete itself during |
119 // this call, since it can be called afterwards. See DeleteDelegate(). | 117 // this call, since it can be called afterwards. See DeleteDelegate(). |
120 virtual void WindowClosing() {} | 118 virtual void WindowClosing() {} |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 virtual const Widget* GetWidget() const OVERRIDE; | 169 virtual const Widget* GetWidget() const OVERRIDE; |
172 | 170 |
173 private: | 171 private: |
174 DISALLOW_COPY_AND_ASSIGN(WidgetDelegateView); | 172 DISALLOW_COPY_AND_ASSIGN(WidgetDelegateView); |
175 }; | 173 }; |
176 | 174 |
177 } // namespace views | 175 } // namespace views |
178 | 176 |
179 #endif // VIEWS_WIDGET_WIDGET_DELEGATE_H_ | 177 #endif // VIEWS_WIDGET_WIDGET_DELEGATE_H_ |
180 | 178 |
OLD | NEW |