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

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

Issue 256783006: ChromeVox enabled for every WebDialog created by call to ShowWebDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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/ui/browser_dialogs.h" 6 #include "chrome/browser/ui/browser_dialogs.h"
6 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" 7 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h"
7 #include "ui/views/controls/webview/web_dialog_view.h" 8 #include "ui/views/controls/webview/web_dialog_view.h"
8 #include "ui/views/widget/widget.h" 9 #include "ui/views/widget/widget.h"
9 10
10 namespace chrome { 11 namespace chrome {
11 12
12 // Declared in browser_dialogs.h so that others don't need to depend on our .h. 13 // Declared in browser_dialogs.h so that others don't need to depend on our .h.
13 gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent, 14 gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent,
14 content::BrowserContext* context, 15 content::BrowserContext* context,
15 ui::WebDialogDelegate* delegate) { 16 ui::WebDialogDelegate* delegate) {
16 views::Widget* widget = NULL; 17 views::Widget* widget = NULL;
18 views::WebDialogView* view =
19 new views::WebDialogView(context, delegate, new ChromeWebContentsHandler);
17 if (parent) { 20 if (parent) {
18 widget = views::Widget::CreateWindowWithParent( 21 widget = views::Widget::CreateWindowWithParent(view, parent);
19 new views::WebDialogView(context,
20 delegate,
21 new ChromeWebContentsHandler),
22 parent);
23 } else { 22 } else {
24 // We shouldn't be called with a NULL parent, but sometimes are. 23 // We shouldn't be called with a NULL parent, but sometimes are.
25 widget = views::Widget::CreateWindow( 24 widget = views::Widget::CreateWindow(view);
26 new views::WebDialogView(context,
27 delegate,
28 new ChromeWebContentsHandler));
29 } 25 }
30 26
27 // Observer is needed for ChromeVox extension to send messages between content
msw 2014/04/28 18:32:45 Are there security concerns with enabling extensio
dzhioev (left Google) 2014/04/28 19:15:53 Creating ChromeExtensionWebContentsObserver makes
dmazzoni 2014/05/22 16:39:52 Thanks for the ping. Confirmed - just adding a Ch
28 // and background scripts.
29 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents(
30 view->web_contents());
31
31 widget->Show(); 32 widget->Show();
32 return widget->GetNativeWindow(); 33 return widget->GetNativeWindow();
33 } 34 }
34 35
35 } // namespace chrome 36 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698