OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/window/dialog_delegate.h" | 5 #include "ui/views/window/dialog_delegate.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "grit/ui_strings.h" | 8 #include "grit/ui_strings.h" |
9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
10 #include "ui/base/ui_base_switches_util.h" | 10 #include "ui/base/ui_base_switches_util.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 color)); | 181 color)); |
182 } | 182 } |
183 frame->SetTitle(widget->widget_delegate()->GetWindowTitle()); | 183 frame->SetTitle(widget->widget_delegate()->GetWindowTitle()); |
184 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); | 184 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); |
185 if (delegate) { | 185 if (delegate) { |
186 View* titlebar_view = delegate->CreateTitlebarExtraView(); | 186 View* titlebar_view = delegate->CreateTitlebarExtraView(); |
187 if (titlebar_view) | 187 if (titlebar_view) |
188 frame->SetTitlebarExtraView(titlebar_view); | 188 frame->SetTitlebarExtraView(titlebar_view); |
189 } | 189 } |
190 frame->SetShowCloseButton(widget->widget_delegate()->ShouldShowCloseButton()); | 190 frame->SetShowCloseButton(widget->widget_delegate()->ShouldShowCloseButton()); |
191 frame->set_can_drag(true); | |
192 if (force_opaque_border) | 191 if (force_opaque_border) |
193 widget->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); | 192 widget->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); |
194 return frame; | 193 return frame; |
195 } | 194 } |
196 | 195 |
197 const DialogClientView* DialogDelegate::GetDialogClientView() const { | 196 const DialogClientView* DialogDelegate::GetDialogClientView() const { |
198 return GetWidget()->client_view()->AsDialogClientView(); | 197 return GetWidget()->client_view()->AsDialogClientView(); |
199 } | 198 } |
200 | 199 |
201 DialogClientView* DialogDelegate::GetDialogClientView() { | 200 DialogClientView* DialogDelegate::GetDialogClientView() { |
(...skipping 24 matching lines...) Expand all Loading... |
226 | 225 |
227 const Widget* DialogDelegateView::GetWidget() const { | 226 const Widget* DialogDelegateView::GetWidget() const { |
228 return View::GetWidget(); | 227 return View::GetWidget(); |
229 } | 228 } |
230 | 229 |
231 View* DialogDelegateView::GetContentsView() { | 230 View* DialogDelegateView::GetContentsView() { |
232 return this; | 231 return this; |
233 } | 232 } |
234 | 233 |
235 } // namespace views | 234 } // namespace views |
OLD | NEW |