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