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 #include "views/widget/widget_delegate.h" | 5 #include "views/widget/widget_delegate.h" |
6 | 6 |
7 #include "views/view.h" | 7 #include "views/view.h" |
8 #include "views/views_delegate.h" | 8 #include "views/views_delegate.h" |
9 #include "views/widget/widget.h" | 9 #include "views/widget/widget.h" |
10 #include "views/window/client_view.h" | 10 #include "views/window/client_view.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 bool WidgetDelegate::ExecuteWindowsCommand(int command_id) { | 92 bool WidgetDelegate::ExecuteWindowsCommand(int command_id) { |
93 return false; | 93 return false; |
94 } | 94 } |
95 | 95 |
96 std::wstring WidgetDelegate::GetWindowName() const { | 96 std::wstring WidgetDelegate::GetWindowName() const { |
97 return std::wstring(); | 97 return std::wstring(); |
98 } | 98 } |
99 | 99 |
100 void WidgetDelegate::SaveWindowPlacement(const gfx::Rect& bounds, | 100 void WidgetDelegate::SaveWindowPlacement(const gfx::Rect& bounds, |
101 ui::WindowShowState show_state) { | 101 bool maximized) { |
102 std::wstring window_name = GetWindowName(); | 102 std::wstring window_name = GetWindowName(); |
103 if (!ViewsDelegate::views_delegate || window_name.empty()) | 103 if (!ViewsDelegate::views_delegate || window_name.empty()) |
104 return; | 104 return; |
105 | 105 |
106 ViewsDelegate::views_delegate->SaveWindowPlacement( | 106 ViewsDelegate::views_delegate->SaveWindowPlacement( |
107 GetWidget(), window_name, bounds, show_state); | 107 GetWidget(), window_name, bounds, maximized); |
108 } | 108 } |
109 | 109 |
110 bool WidgetDelegate::GetSavedWindowPlacement( | 110 bool WidgetDelegate::GetSavedWindowBounds(gfx::Rect* bounds) const { |
111 gfx::Rect* bounds, | |
112 ui::WindowShowState* show_state) const { | |
113 std::wstring window_name = GetWindowName(); | 111 std::wstring window_name = GetWindowName(); |
114 if (!ViewsDelegate::views_delegate || window_name.empty()) | 112 if (!ViewsDelegate::views_delegate || window_name.empty()) |
115 return false; | 113 return false; |
116 | 114 |
117 return ViewsDelegate::views_delegate->GetSavedWindowPlacement( | 115 return ViewsDelegate::views_delegate->GetSavedWindowBounds( |
118 window_name, bounds, show_state); | 116 window_name, bounds); |
| 117 } |
| 118 |
| 119 bool WidgetDelegate::GetSavedMaximizedState(bool* maximized) const { |
| 120 std::wstring window_name = GetWindowName(); |
| 121 if (!ViewsDelegate::views_delegate || window_name.empty()) |
| 122 return false; |
| 123 |
| 124 return ViewsDelegate::views_delegate->GetSavedMaximizedState( |
| 125 window_name, maximized); |
119 } | 126 } |
120 | 127 |
121 bool WidgetDelegate::ShouldRestoreWindowSize() const { | 128 bool WidgetDelegate::ShouldRestoreWindowSize() const { |
122 return true; | 129 return true; |
123 } | 130 } |
124 | 131 |
125 View* WidgetDelegate::GetContentsView() { | 132 View* WidgetDelegate::GetContentsView() { |
126 if (!default_contents_view_) | 133 if (!default_contents_view_) |
127 default_contents_view_ = new View; | 134 default_contents_view_ = new View; |
128 return default_contents_view_; | 135 return default_contents_view_; |
(...skipping 23 matching lines...) Expand all Loading... |
152 Widget* WidgetDelegateView::GetWidget() { | 159 Widget* WidgetDelegateView::GetWidget() { |
153 return View::GetWidget(); | 160 return View::GetWidget(); |
154 } | 161 } |
155 | 162 |
156 const Widget* WidgetDelegateView::GetWidget() const { | 163 const Widget* WidgetDelegateView::GetWidget() const { |
157 return View::GetWidget(); | 164 return View::GetWidget(); |
158 } | 165 } |
159 | 166 |
160 } // namespace views | 167 } // namespace views |
161 | 168 |
OLD | NEW |