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 bool maximized) { | 101 ui::WindowShowState show_state) { |
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, maximized); | 107 GetWidget(), window_name, bounds, show_state); |
108 } | 108 } |
109 | 109 |
110 bool WidgetDelegate::GetSavedWindowBounds(gfx::Rect* bounds) const { | 110 bool WidgetDelegate::GetSavedWindowPlacement( |
| 111 gfx::Rect* bounds, |
| 112 ui::WindowShowState* show_state) const { |
111 std::wstring window_name = GetWindowName(); | 113 std::wstring window_name = GetWindowName(); |
112 if (!ViewsDelegate::views_delegate || window_name.empty()) | 114 if (!ViewsDelegate::views_delegate || window_name.empty()) |
113 return false; | 115 return false; |
114 | 116 |
115 return ViewsDelegate::views_delegate->GetSavedWindowBounds( | 117 return ViewsDelegate::views_delegate->GetSavedWindowPlacement( |
116 window_name, bounds); | 118 window_name, bounds, show_state); |
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); | |
126 } | 119 } |
127 | 120 |
128 bool WidgetDelegate::ShouldRestoreWindowSize() const { | 121 bool WidgetDelegate::ShouldRestoreWindowSize() const { |
129 return true; | 122 return true; |
130 } | 123 } |
131 | 124 |
132 View* WidgetDelegate::GetContentsView() { | 125 View* WidgetDelegate::GetContentsView() { |
133 if (!default_contents_view_) | 126 if (!default_contents_view_) |
134 default_contents_view_ = new View; | 127 default_contents_view_ = new View; |
135 return default_contents_view_; | 128 return default_contents_view_; |
(...skipping 23 matching lines...) Expand all Loading... |
159 Widget* WidgetDelegateView::GetWidget() { | 152 Widget* WidgetDelegateView::GetWidget() { |
160 return View::GetWidget(); | 153 return View::GetWidget(); |
161 } | 154 } |
162 | 155 |
163 const Widget* WidgetDelegateView::GetWidget() const { | 156 const Widget* WidgetDelegateView::GetWidget() const { |
164 return View::GetWidget(); | 157 return View::GetWidget(); |
165 } | 158 } |
166 | 159 |
167 } // namespace views | 160 } // namespace views |
168 | 161 |
OLD | NEW |