diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-10 00:08:51 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-10 00:08:51 +0000 |
commit | 92a37b488c6481a400ac2903d6b1dfbd1ae14e9d (patch) | |
tree | 4964bb8759527e3a5d98e23f15695408e3d44e4f | |
parent | 410fbd69f0b0708246fc5266b81436fd620479d9 (diff) | |
download | chromium_src-92a37b488c6481a400ac2903d6b1dfbd1ae14e9d.zip chromium_src-92a37b488c6481a400ac2903d6b1dfbd1ae14e9d.tar.gz chromium_src-92a37b488c6481a400ac2903d6b1dfbd1ae14e9d.tar.bz2 |
aura: Implement ExtensionView::CreateWidgetHostView().
The NOTIMPLEMENTED() here was resulting in a crash in some
cases (e.g. when trying to show a file browser dialog).
BUG=103292
TEST=manual: tried to save a file and checked that we don't crash (a dialog gets opened, but it's empty, presumably because there's more that needs to get implemented in that area)
Review URL: http://codereview.chromium.org/8493028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109339 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/views/extensions/extension_view.cc | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/chrome/browser/ui/views/extensions/extension_view.cc b/chrome/browser/ui/views/extensions/extension_view.cc index 0674faa..62f1292 100644 --- a/chrome/browser/ui/views/extensions/extension_view.cc +++ b/chrome/browser/ui/views/extensions/extension_view.cc @@ -11,12 +11,14 @@ #include "content/public/browser/content_browser_client.h" #include "views/widget/widget.h" -#if defined(OS_WIN) -#include "content/browser/renderer_host/render_widget_host_view_win.h" -#elif defined(TOUCH_UI) || defined(USE_AURA) +#if defined(USE_AURA) +#include "content/browser/renderer_host/render_widget_host_view_aura.h" +#elif defined(TOUCH_UI) #include "chrome/browser/renderer_host/render_widget_host_view_views.h" #elif defined(TOOLKIT_USES_GTK) #include "content/browser/renderer_host/render_widget_host_view_gtk.h" +#elif defined(OS_WIN) +#include "content/browser/renderer_host/render_widget_host_view_win.h" #endif ExtensionView::ExtensionView(ExtensionHost* host, Browser* browser) @@ -88,8 +90,11 @@ void ExtensionView::CreateWidgetHostView() { // TODO(mpcomplete): RWHV needs a cross-platform Init function. #if defined(USE_AURA) - // TODO(beng): should be same as TOUCH_UI - NOTIMPLEMENTED(); + static_cast<RenderWidgetHostViewAura*>(view)->InitAsChild(); +#elif defined(TOUCH_UI) + static_cast<RenderWidgetHostViewViews*>(view)->InitAsChild(); +#elif defined(TOOLKIT_USES_GTK) + static_cast<RenderWidgetHostViewGtk*>(view)->InitAsChild(); #elif defined(OS_WIN) // Create the HWND. Note: // RenderWidgetHostHWND supports windowed plugins, but if we ever also @@ -98,23 +103,13 @@ void ExtensionView::CreateWidgetHostView() { // exist in the same z-order as constrained windows. RenderWidgetHostViewWin* view_win = static_cast<RenderWidgetHostViewWin*>(view); - HWND hwnd = view_win->Create(GetWidget()->GetNativeView()); + view_win->Create(GetWidget()->GetNativeView()); view_win->ShowWindow(SW_SHOW); - Attach(hwnd); -#elif defined(TOUCH_UI) - RenderWidgetHostViewViews* view_views = - static_cast<RenderWidgetHostViewViews*>(view); - view_views->InitAsChild(); - AttachToView(view_views); -#elif defined(TOOLKIT_USES_GTK) - RenderWidgetHostViewGtk* view_gtk = - static_cast<RenderWidgetHostViewGtk*>(view); - view_gtk->InitAsChild(); - Attach(view_gtk->GetNativeView()); #else NOTIMPLEMENTED(); #endif + Attach(view->GetNativeView()); host_->CreateRenderViewSoon(view); SetVisible(false); } |