| 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/window/client_view.h" | 9 #include "views/window/client_view.h" |
| 10 #include "views/window/window.h" | 10 #include "views/window/window.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 bool maximized) { |
| 102 DCHECK(window_); | |
| 103 std::wstring window_name = GetWindowName(); | 102 std::wstring window_name = GetWindowName(); |
| 104 if (!ViewsDelegate::views_delegate || window_name.empty()) | 103 if (!ViewsDelegate::views_delegate || window_name.empty()) |
| 105 return; | 104 return; |
| 106 | 105 |
| 107 ViewsDelegate::views_delegate->SaveWindowPlacement( | 106 ViewsDelegate::views_delegate->SaveWindowPlacement( |
| 108 window_, window_name, bounds, maximized); | 107 window_, window_name, bounds, maximized); |
| 109 } | 108 } |
| 110 | 109 |
| 111 bool WidgetDelegate::GetSavedWindowBounds(gfx::Rect* bounds) const { | 110 bool WidgetDelegate::GetSavedWindowBounds(gfx::Rect* bounds) const { |
| 112 DCHECK(window_); | 111 DCHECK(window_); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 126 | 125 |
| 127 return ViewsDelegate::views_delegate->GetSavedMaximizedState( | 126 return ViewsDelegate::views_delegate->GetSavedMaximizedState( |
| 128 window_, window_name, maximized); | 127 window_, window_name, maximized); |
| 129 } | 128 } |
| 130 | 129 |
| 131 bool WidgetDelegate::ShouldRestoreWindowSize() const { | 130 bool WidgetDelegate::ShouldRestoreWindowSize() const { |
| 132 return true; | 131 return true; |
| 133 } | 132 } |
| 134 | 133 |
| 135 View* WidgetDelegate::GetContentsView() { | 134 View* WidgetDelegate::GetContentsView() { |
| 136 return NULL; | 135 return new View; |
| 137 } | 136 } |
| 138 | 137 |
| 139 ClientView* WidgetDelegate::CreateClientView(Window* window) { | 138 ClientView* WidgetDelegate::CreateClientView(Widget* widget) { |
| 140 return new ClientView(window, GetContentsView()); | 139 return new ClientView(widget, GetContentsView()); |
| 141 } | 140 } |
| 142 | 141 |
| 143 NonClientFrameView* WidgetDelegate::CreateNonClientFrameView() { | 142 NonClientFrameView* WidgetDelegate::CreateNonClientFrameView() { |
| 144 return NULL; | 143 return NULL; |
| 145 } | 144 } |
| 146 | 145 |
| 147 bool WidgetDelegate::WillProcessWorkAreaChange() const { | 146 bool WidgetDelegate::WillProcessWorkAreaChange() const { |
| 148 return false; | 147 return false; |
| 149 } | 148 } |
| 150 | 149 |
| 151 } // namespace views | 150 } // namespace views |
| 152 | 151 |
| OLD | NEW |