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

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

Issue 14049016: Enable new dialog style transparency with Views Textfields. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | « ui/views/controls/textfield/textfield.cc ('k') | 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"
(...skipping 14 matching lines...) Expand all
25 namespace { 25 namespace {
26 26
27 // Create a widget to host the dialog. 27 // Create a widget to host the dialog.
28 Widget* CreateDialogWidgetImpl(DialogDelegateView* dialog_delegate_view, 28 Widget* CreateDialogWidgetImpl(DialogDelegateView* dialog_delegate_view,
29 gfx::NativeWindow context, 29 gfx::NativeWindow context,
30 gfx::NativeWindow parent) { 30 gfx::NativeWindow parent) {
31 views::Widget* widget = new views::Widget; 31 views::Widget* widget = new views::Widget;
32 views::Widget::InitParams params; 32 views::Widget::InitParams params;
33 params.delegate = dialog_delegate_view; 33 params.delegate = dialog_delegate_view;
34 if (DialogDelegate::UseNewStyle()) { 34 if (DialogDelegate::UseNewStyle()) {
35 // TODO(msw): Avoid Windows native controls or support dialog transparency 35 // Note: Transparent widgets cannot host native Windows textfield controls.
36 // with a separate border Widget, like BubbleDelegateView. 36 params.transparent = true;
37 params.transparent = views::View::get_use_acceleration_when_possible();
38 params.remove_standard_frame = true; 37 params.remove_standard_frame = true;
39 } 38 }
40 params.context = context; 39 params.context = context;
41 params.parent = parent; 40 params.parent = parent;
42 params.top_level = true; 41 params.top_level = true;
43 widget->Init(params); 42 widget->Init(params);
44 if (DialogDelegate::UseNewStyle()) { 43 if (DialogDelegate::UseNewStyle()) {
45 #if defined(USE_AURA) 44 #if defined(USE_AURA)
46 // TODO(msw): Add a matching shadow type and remove the bubble frame border? 45 // TODO(msw): Add a matching shadow type and remove the bubble frame border?
47 corewm::SetShadowType(widget->GetNativeWindow(), corewm::SHADOW_TYPE_NONE); 46 corewm::SetShadowType(widget->GetNativeWindow(), corewm::SHADOW_TYPE_NONE);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 208
210 const Widget* DialogDelegateView::GetWidget() const { 209 const Widget* DialogDelegateView::GetWidget() const {
211 return View::GetWidget(); 210 return View::GetWidget();
212 } 211 }
213 212
214 View* DialogDelegateView::GetContentsView() { 213 View* DialogDelegateView::GetContentsView() {
215 return this; 214 return this;
216 } 215 }
217 216
218 } // namespace views 217 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698