summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/printing/print_preview_dialog_controller.cc2
-rw-r--r--chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc11
2 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/printing/print_preview_dialog_controller.cc b/chrome/browser/printing/print_preview_dialog_controller.cc
index 85b7826..17eb41c 100644
--- a/chrome/browser/printing/print_preview_dialog_controller.cc
+++ b/chrome/browser/printing/print_preview_dialog_controller.cc
@@ -156,8 +156,6 @@ void PrintPreviewDialogDelegate::OnCloseContents(WebContents* /* source */,
}
bool PrintPreviewDialogDelegate::ShouldShowDialogTitle() const {
- // Not used, returning dummy value.
- NOTREACHED();
return false;
}
diff --git a/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc b/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc
index c05c1d7..7d86371 100644
--- a/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc
+++ b/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc
@@ -17,6 +17,7 @@
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
+#include "ui/views/window/dialog_delegate.h"
#include "ui/web_dialogs/web_dialog_delegate.h"
#include "ui/web_dialogs/web_dialog_ui.h"
@@ -134,6 +135,10 @@ class ConstrainedWebDialogDelegateViewViews
widget,
GetWebContents()->GetBrowserContext());
}
+ virtual bool ShouldShowCloseButton() const OVERRIDE {
+ // No close button if the dialog doesn't want a title bar.
+ return impl_->GetWebDialogDelegate()->ShouldShowDialogTitle();
+ }
virtual ui::ModalType GetModalType() const OVERRIDE {
#if defined(USE_ASH)
@@ -149,8 +154,10 @@ class ConstrainedWebDialogDelegateViewViews
if (!GetWidget())
return;
- GetWidget()->CenterWindow(
- GetWidget()->non_client_view()->GetPreferredSize());
+ if (!views::DialogDelegate::UseNewStyle()) {
+ GetWidget()->CenterWindow(
+ GetWidget()->non_client_view()->GetPreferredSize());
+ }
views::WidgetDelegate::OnWidgetMove();
}