| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |