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

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

Issue 2446573003: chromeos: Make "mobile network" and "set time" dialogs work with mash (Closed)
Patch Set: cleanup Created 4 years, 1 month 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
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/extensions/chrome_extension_web_contents_observer.h" 5 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
6 #include "chrome/browser/ui/browser_dialogs.h" 6 #include "chrome/browser/ui/browser_dialogs.h"
7 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" 7 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h"
8 #include "ui/views/controls/webview/web_dialog_view.h" 8 #include "ui/views/controls/webview/web_dialog_view.h"
9 #include "ui/views/widget/widget.h" 9 #include "ui/views/widget/widget.h"
10 10
11 #if defined(USE_ASH)
12 #include "chrome/browser/ui/ash/ash_util.h"
13 #include "ui/aura/mus/mus_util.h"
14 #endif // defined(USE_ASH)
15
11 namespace chrome { 16 namespace chrome {
12 17
13 // Declared in browser_dialogs.h so that others don't need to depend on our .h. 18 // Declared in browser_dialogs.h so that others don't need to depend on our .h.
14 gfx::NativeWindow ShowWebDialog(gfx::NativeView parent, 19 gfx::NativeWindow ShowWebDialog(gfx::NativeView parent,
15 content::BrowserContext* context, 20 content::BrowserContext* context,
16 ui::WebDialogDelegate* delegate) { 21 ui::WebDialogDelegate* delegate) {
17 views::WebDialogView* view = 22 views::WebDialogView* view =
18 new views::WebDialogView(context, delegate, new ChromeWebContentsHandler); 23 new views::WebDialogView(context, delegate, new ChromeWebContentsHandler);
24 views::Widget* widget = new views::Widget;
25 views::Widget::InitParams params;
26 params.delegate = view;
19 // NOTE: The |parent| may be null, which will result in the default window 27 // NOTE: The |parent| may be null, which will result in the default window
20 // placement on Aura. 28 // placement on Aura.
21 views::Widget* widget = views::Widget::CreateWindowWithParent(view, parent); 29 params.parent = parent;
30 #if defined(USE_ASH)
31 if (chrome::IsRunningInMash())
32 params.parent_mus = aura::GetMusWindow(parent);
33 #endif // defined(USE_ASH)
34 widget->Init(params);
22 35
23 // Observer is needed for ChromeVox extension to send messages between content 36 // Observer is needed for ChromeVox extension to send messages between content
24 // and background scripts. 37 // and background scripts.
25 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( 38 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents(
26 view->web_contents()); 39 view->web_contents());
27 40
28 widget->Show(); 41 widget->Show();
29 return widget->GetNativeWindow(); 42 return widget->GetNativeWindow();
30 } 43 }
31 44
32 } // namespace chrome 45 } // namespace chrome
OLDNEW
« chrome/browser/ui/ash/web_dialog_util.cc ('K') | « chrome/browser/ui/ash/web_dialog_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698