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

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

Issue 2871073002: cros: Bind hangup red button on remote controller to close web dialog (Closed)
Patch Set: nits Created 3 years, 7 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
« no previous file with comments | « chrome/browser/ui/browser_dialogs.h ('k') | ui/views/controls/webview/web_dialog_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 new views::WebDialogView(context, delegate, new ChromeWebContentsHandler); 43 new views::WebDialogView(context, delegate, new ChromeWebContentsHandler);
44 views::Widget::InitParams params; 44 views::Widget::InitParams params;
45 params.delegate = view; 45 params.delegate = view;
46 // NOTE: The |parent| may be null, which will result in the default window 46 // NOTE: The |parent| may be null, which will result in the default window
47 // placement on Aura. 47 // placement on Aura.
48 params.parent = parent; 48 params.parent = parent;
49 return ShowWebDialogWidget(params, view); 49 return ShowWebDialogWidget(params, view);
50 } 50 }
51 51
52 #if defined(USE_ASH) 52 #if defined(USE_ASH)
53 void ShowWebDialogInContainer(int container_id, 53 gfx::NativeWindow ShowWebDialogInContainer(int container_id,
54 content::BrowserContext* context, 54 content::BrowserContext* context,
55 ui::WebDialogDelegate* delegate) { 55 ui::WebDialogDelegate* delegate) {
56 DCHECK(container_id != ash::kShellWindowId_Invalid); 56 DCHECK(container_id != ash::kShellWindowId_Invalid);
57 views::WebDialogView* view = 57 views::WebDialogView* view =
58 new views::WebDialogView(context, delegate, new ChromeWebContentsHandler); 58 new views::WebDialogView(context, delegate, new ChromeWebContentsHandler);
59 views::Widget::InitParams params; 59 views::Widget::InitParams params;
60 params.delegate = view; 60 params.delegate = view;
61 if (ash_util::IsRunningInMash()) { 61 if (ash_util::IsRunningInMash()) {
62 using ui::mojom::WindowManager; 62 using ui::mojom::WindowManager;
63 params.mus_properties[WindowManager::kContainerId_InitProperty] = 63 params.mus_properties[WindowManager::kContainerId_InitProperty] =
64 mojo::ConvertTo<std::vector<uint8_t>>(container_id); 64 mojo::ConvertTo<std::vector<uint8_t>>(container_id);
65 } else { 65 } else {
66 params.parent = ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), 66 params.parent = ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
67 container_id); 67 container_id);
68 } 68 }
69 ShowWebDialogWidget(params, view); 69 return ShowWebDialogWidget(params, view);
70 } 70 }
71 #endif // defined(USE_ASH) 71 #endif // defined(USE_ASH)
72 72
73 } // namespace chrome 73 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_dialogs.h ('k') | ui/views/controls/webview/web_dialog_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698