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

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

Issue 12026016: Implement new Task Manager and Edit Bookmark style, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comment. Created 7 years, 11 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 439f5ccc56b664d058ed6098a06b3f1bc0ba0671..33a1b9aac9e8300cf97da4df5867beddf9b0039b 100644
--- a/ui/views/window/dialog_delegate.cc
+++ b/ui/views/window/dialog_delegate.cc
@@ -9,11 +9,37 @@
#include "ui/base/ui_base_switches.h"
#include "ui/views/controls/button/text_button.h"
#include "ui/views/widget/widget.h"
+#include "ui/views/widget/widget_observer.h"
#include "ui/views/window/dialog_client_view.h"
#include "ui/views/window/dialog_frame_view.h"
namespace views {
+namespace {
+
+// Create a widget to host the dialog.
+Widget* CreateDialogWidgetImpl(DialogDelegateView* dialog_delegate_view,
+ gfx::NativeWindow context,
+ gfx::NativeWindow parent) {
+ views::Widget* widget = new views::Widget;
+ views::Widget::InitParams params;
+ params.delegate = dialog_delegate_view;
+ if (DialogDelegate::UseNewStyle()) {
+ // TODO(msw): Avoid Windows native controls or support dialog transparency
+ // with a separate border Widget, like BubbleDelegateView.
+ params.transparent = views::View::get_use_acceleration_when_possible();
+ params.remove_standard_frame = true;
+ }
+ params.context = context;
+ params.parent = parent;
+ params.top_level = true;
+ widget->Init(params);
+ return widget;
+}
+
+} // namespace
+
+
////////////////////////////////////////////////////////////////////////////////
// DialogDelegate:
@@ -125,10 +151,15 @@ ui::AccessibilityTypes::Role DialogDelegate::GetAccessibleWindowRole() const {
////////////////////////////////////////////////////////////////////////////////
// DialogDelegateView:
-DialogDelegateView::DialogDelegateView() {
-}
+DialogDelegateView::DialogDelegateView() {}
-DialogDelegateView::~DialogDelegateView() {
+DialogDelegateView::~DialogDelegateView() {}
+
+// static
+Widget* DialogDelegateView::CreateDialogWidget(DialogDelegateView* dialog,
+ gfx::NativeWindow context,
+ gfx::NativeWindow parent) {
+ return CreateDialogWidgetImpl(dialog, context, parent);
}
Widget* DialogDelegateView::GetWidget() {
« 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