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

Side by Side Diff: ui/views/window/dialog_delegate.cc

Issue 12391056: Remove Aura's extra shadowed border in the new dialog style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove NativeWidgetAura's shadow in DialogDelegate Widget construction. Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "grit/ui_strings.h" 9 #include "grit/ui_strings.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
11 #include "ui/base/ui_base_switches.h" 11 #include "ui/base/ui_base_switches.h"
12 #include "ui/views/bubble/bubble_border.h" 12 #include "ui/views/bubble/bubble_border.h"
13 #include "ui/views/bubble/bubble_frame_view.h" 13 #include "ui/views/bubble/bubble_frame_view.h"
14 #include "ui/views/controls/button/label_button.h" 14 #include "ui/views/controls/button/label_button.h"
15 #include "ui/views/widget/widget.h" 15 #include "ui/views/widget/widget.h"
16 #include "ui/views/widget/widget_observer.h" 16 #include "ui/views/widget/widget_observer.h"
17 #include "ui/views/window/dialog_client_view.h" 17 #include "ui/views/window/dialog_client_view.h"
18 18
19 #if defined(USE_AURA)
20 #include "ui/views/corewm/shadow_types.h"
21 #endif
22
19 namespace views { 23 namespace views {
20 24
21 namespace { 25 namespace {
22 26
23 // Create a widget to host the dialog. 27 // Create a widget to host the dialog.
24 Widget* CreateDialogWidgetImpl(DialogDelegateView* dialog_delegate_view, 28 Widget* CreateDialogWidgetImpl(DialogDelegateView* dialog_delegate_view,
25 gfx::NativeWindow context, 29 gfx::NativeWindow context,
26 gfx::NativeWindow parent) { 30 gfx::NativeWindow parent) {
27 views::Widget* widget = new views::Widget; 31 views::Widget* widget = new views::Widget;
28 views::Widget::InitParams params; 32 views::Widget::InitParams params;
29 params.delegate = dialog_delegate_view; 33 params.delegate = dialog_delegate_view;
30 if (DialogDelegate::UseNewStyle()) { 34 if (DialogDelegate::UseNewStyle()) {
31 // TODO(msw): Avoid Windows native controls or support dialog transparency 35 // TODO(msw): Avoid Windows native controls or support dialog transparency
32 // with a separate border Widget, like BubbleDelegateView. 36 // with a separate border Widget, like BubbleDelegateView.
33 params.transparent = views::View::get_use_acceleration_when_possible(); 37 params.transparent = views::View::get_use_acceleration_when_possible();
34 params.remove_standard_frame = true; 38 params.remove_standard_frame = true;
35 } 39 }
36 params.context = context; 40 params.context = context;
37 params.parent = parent; 41 params.parent = parent;
38 params.top_level = true; 42 params.top_level = true;
39 widget->Init(params); 43 widget->Init(params);
44 if (DialogDelegate::UseNewStyle()) {
45 #if defined(USE_AURA)
46 // TODO(msw): Add a matching shadow type and remove the bubble frame border?
47 corewm::SetShadowType(widget->GetNativeWindow(), corewm::SHADOW_TYPE_NONE);
48 #endif
49 }
40 return widget; 50 return widget;
41 } 51 }
42 52
43 } // namespace 53 } // namespace
44 54
45 55
46 //////////////////////////////////////////////////////////////////////////////// 56 ////////////////////////////////////////////////////////////////////////////////
47 // DialogDelegate: 57 // DialogDelegate:
48 58
49 DialogDelegate::~DialogDelegate() { 59 DialogDelegate::~DialogDelegate() {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 209
200 const Widget* DialogDelegateView::GetWidget() const { 210 const Widget* DialogDelegateView::GetWidget() const {
201 return View::GetWidget(); 211 return View::GetWidget();
202 } 212 }
203 213
204 View* DialogDelegateView::GetContentsView() { 214 View* DialogDelegateView::GetContentsView() {
205 return this; 215 return this;
206 } 216 }
207 217
208 } // namespace views 218 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698