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

Side by Side Diff: chrome/browser/ui/views/chrome_web_dialog_view.cc

Issue 11829040: Fix the content_browsertests everywhere maybe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And fix the final ExtensionApiTest.AlertBasic case. 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 unified diff | Download patch | Annotate | Revision Log
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 "chrome/browser/ui/browser_dialogs.h" 5 #include "chrome/browser/ui/browser_dialogs.h"
6 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" 6 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h"
7 #include "ui/views/controls/webview/web_dialog_view.h" 7 #include "ui/views/controls/webview/web_dialog_view.h"
8 #include "ui/views/widget/widget.h" 8 #include "ui/views/widget/widget.h"
9 9
10 namespace chrome { 10 namespace chrome {
11 11
12 // Declared in browser_dialogs.h so that others don't need to depend on our .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, 13 gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent,
14 content::BrowserContext* context, 14 content::BrowserContext* context,
15 ui::WebDialogDelegate* delegate) { 15 ui::WebDialogDelegate* delegate) {
16 views::Widget* widget = views::Widget::CreateWindowWithParent( 16 views::Widget* widget = NULL;
17 new views::WebDialogView(context, delegate, new ChromeWebContentsHandler), 17 if (parent) {
18 parent); 18 widget = views::Widget::CreateWindowWithParent(
19 new views::WebDialogView(context,
20 delegate,
21 new ChromeWebContentsHandler),
22 parent);
23 } else {
24 // We shouldn't be called with a NULL parent, but sometimes are.
25 widget = views::Widget::CreateWindow(
26 new views::WebDialogView(context,
27 delegate,
28 new ChromeWebContentsHandler));
29 }
30
19 widget->Show(); 31 widget->Show();
20 return widget->GetNativeWindow(); 32 return widget->GetNativeWindow();
21 } 33 }
22 34
23 } // namespace chrome 35 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698