| Index: ui/views/window/dialog_delegate.cc
|
| diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc
|
| index 9f005d82e80e6deb6a1de8329574db5ca00039de..3783cc7767c24b37232dc1f8bce848851c5bab31 100644
|
| --- a/ui/views/window/dialog_delegate.cc
|
| +++ b/ui/views/window/dialog_delegate.cc
|
| @@ -4,16 +4,26 @@
|
|
|
| #include "ui/views/window/dialog_delegate.h"
|
|
|
| +#include "base/command_line.h"
|
| #include "base/logging.h"
|
| +#include "ui/base/ui_base_switches.h"
|
| #include "ui/views/controls/button/text_button.h"
|
| #include "ui/views/widget/widget.h"
|
| #include "ui/views/window/dialog_client_view.h"
|
| +#include "ui/views/window/dialog_frame_view.h"
|
|
|
| namespace views {
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // DialogDelegate:
|
|
|
| +// static
|
| +bool DialogDelegate::UseNewStyle() {
|
| + static const bool use_new_style = CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableNewDialogStyle);
|
| + return use_new_style;
|
| +}
|
| +
|
| DialogDelegate* DialogDelegate::AsDialogDelegate() { return this; }
|
|
|
| DialogDelegate::~DialogDelegate() {
|
| @@ -45,10 +55,6 @@ bool DialogDelegate::IsDialogButtonVisible(ui::DialogButton button) const {
|
| return true;
|
| }
|
|
|
| -bool DialogDelegate::UseChromeStyle() const {
|
| - return false;
|
| -}
|
| -
|
| bool DialogDelegate::AreAcceleratorsEnabled(ui::DialogButton button) {
|
| return true;
|
| }
|
| @@ -94,11 +100,12 @@ View* DialogDelegate::GetInitiallyFocusedView() {
|
| }
|
|
|
| ClientView* DialogDelegate::CreateClientView(Widget* widget) {
|
| - DialogClientView::StyleParams params = UseChromeStyle() ?
|
| - DialogClientView::GetChromeStyleParams() :
|
| - DialogClientView::StyleParams();
|
| + return new DialogClientView(widget, GetContentsView());
|
| +}
|
|
|
| - return new DialogClientView(widget, GetContentsView(), params);
|
| +NonClientFrameView* DialogDelegate::CreateNonClientFrameView(Widget* widget) {
|
| + return UseNewStyle() ? new DialogFrameView() :
|
| + WidgetDelegate::CreateNonClientFrameView(widget);
|
| }
|
|
|
| const DialogClientView* DialogDelegate::GetDialogClientView() const {
|
| @@ -130,4 +137,8 @@ const Widget* DialogDelegateView::GetWidget() const {
|
| return View::GetWidget();
|
| }
|
|
|
| +View* DialogDelegateView::GetContentsView() {
|
| + return this;
|
| +}
|
| +
|
| } // namespace views
|
|
|