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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/browser_dialogs.h"
6 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h"
7 #include "ui/views/controls/webview/web_dialog_view.h"
8 #include "ui/views/widget/widget.h"
12 // Declared in browser_dialogs.h so that others don't need to depend on our .h.
13 gfx::NativeWindow
ShowWebDialog(gfx::NativeWindow parent
,
14 content::BrowserContext
* context
,
15 ui::WebDialogDelegate
* delegate
) {
16 views::Widget
* widget
= NULL
;
18 widget
= views::Widget::CreateWindowWithParent(
19 new views::WebDialogView(context
,
21 new ChromeWebContentsHandler
),
24 // We shouldn't be called with a NULL parent, but sometimes are.
25 widget
= views::Widget::CreateWindow(
26 new views::WebDialogView(context
,
28 new ChromeWebContentsHandler
));
32 return widget
->GetNativeWindow();