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

Unified Diff: ui/views/window/dialog_client_view.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 | « chrome/browser/ui/views/task_manager_view.cc ('k') | ui/views/window/dialog_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_client_view.cc
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index b6d1695f3f9eba87283176a88a3a7252dab7656f..08d2cfc4996faacbbc6f01f1975bbce9ecfba884 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -40,13 +40,6 @@ DialogClientView::DialogClientView(Widget* owner, View* contents_view)
extra_view_(NULL),
footnote_view_(NULL),
notified_delegate_(false) {
- // When using the new style, the background color is set on the bubble frame,
- // so a transparent background is fine.
- if (!DialogDelegate::UseNewStyle()) {
- const SkColor color = owner->GetNativeTheme()->GetSystemColor(
- ui::NativeTheme::kColorId_DialogBackground);
- set_background(views::Background::CreateSolidBackground(color));
- }
}
DialogClientView::~DialogClientView() {
@@ -263,6 +256,15 @@ void DialogClientView::ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) {
ClientView::ViewHierarchyChanged(details);
if (details.is_add && details.child == this) {
+ // The old dialog style needs an explicit background color, while the new
+ // dialog style simply inherits the bubble's frame view color.
+ const DialogDelegate* dialog = GetDialogDelegate();
+ const bool use_new_style = dialog ?
+ dialog->UseNewStyleForThisDialog() : DialogDelegate::UseNewStyle();
+ if (!use_new_style)
+ set_background(views::Background::CreateSolidBackground(GetNativeTheme()->
+ GetSystemColor(ui::NativeTheme::kColorId_DialogBackground)));
+
focus_manager_ = GetFocusManager();
if (focus_manager_)
GetFocusManager()->AddFocusChangeListener(this);
« no previous file with comments | « chrome/browser/ui/views/task_manager_view.cc ('k') | ui/views/window/dialog_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698