Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1780)

Unified Diff: ui/views/window/dialog_delegate.cc

Issue 15731007: Add dialog-specific styling, restore old-style task manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_delegate.cc
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc
index 3f73ebfbc0c1b46530e99f109ad6de174eb346e0..78b437441cf83585d9a6ce14275878490515d8b9 100644
--- a/ui/views/window/dialog_delegate.cc
+++ b/ui/views/window/dialog_delegate.cc
@@ -39,7 +39,9 @@ Widget* DialogDelegate::CreateDialogWidget(DialogDelegate* dialog,
views::Widget* widget = new views::Widget;
views::Widget::InitParams params;
params.delegate = dialog;
- if (DialogDelegate::UseNewStyle()) {
+ const bool use_new_style = dialog ?
+ dialog->UseNewStyleForThisDialog() : DialogDelegate::UseNewStyle();
+ if (use_new_style) {
// Note: Transparent widgets cannot host native Windows textfield controls.
params.transparent = true;
params.remove_standard_frame = true;
@@ -48,7 +50,7 @@ Widget* DialogDelegate::CreateDialogWidget(DialogDelegate* dialog,
params.parent = parent;
params.top_level = true;
widget->Init(params);
- if (DialogDelegate::UseNewStyle()) {
+ if (use_new_style) {
#if defined(USE_AURA)
// TODO(msw): Add a matching shadow type and remove the bubble frame border?
corewm::SetShadowType(widget->GetNativeWindow(), corewm::SHADOW_TYPE_NONE);
@@ -155,8 +157,9 @@ ClientView* DialogDelegate::CreateClientView(Widget* widget) {
}
NonClientFrameView* DialogDelegate::CreateNonClientFrameView(Widget* widget) {
- return UseNewStyle() ? CreateNewStyleFrameView(widget) :
- WidgetDelegate::CreateNonClientFrameView(widget);
+ if (UseNewStyleForThisDialog())
+ return CreateNewStyleFrameView(widget);
+ return WidgetDelegate::CreateNonClientFrameView(widget);
}
// static
@@ -193,6 +196,10 @@ NonClientFrameView* DialogDelegate::CreateNewStyleFrameView(
return frame;
}
+bool DialogDelegate::UseNewStyleForThisDialog() const {
+ return UseNewStyle();
+}
+
const DialogClientView* DialogDelegate::GetDialogClientView() const {
return GetWidget()->client_view()->AsDialogClientView();
}
« no previous file with comments | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698