Index: chrome/browser/ui/views/chrome_views_delegate.cc |
diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc |
index 3d4448ecdd0ddb8f111121b0c8b34c96edec66a6..9a4d04e2bfe84e25e2aa510a0756efb82be04b2a 100644 |
--- a/chrome/browser/ui/views/chrome_views_delegate.cc |
+++ b/chrome/browser/ui/views/chrome_views_delegate.cc |
@@ -24,9 +24,12 @@ |
#include "chrome/browser/app_icon_win.h" |
#endif |
+#if defined(USE_AURA) |
+#include "ui/aura/root_window.h" |
+#endif |
+ |
#if defined(USE_AURA) && !defined(OS_CHROMEOS) |
#include "chrome/browser/ui/host_desktop.h" |
-#include "ui/aura/root_window.h" |
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
#include "ui/views/widget/native_widget_aura.h" |
#endif |
@@ -174,12 +177,18 @@ content::WebContents* ChromeViewsDelegate::CreateWebContents( |
void ChromeViewsDelegate::OnBeforeWidgetInit( |
views::Widget::InitParams* params, |
views::internal::NativeWidgetDelegate* delegate) { |
-#if defined(USE_AURA) && !defined(OS_CHROMEOS) |
// If we already have a native_widget, we don't have to try to come |
// up with one. |
if (params->native_widget) |
return; |
+#if defined(OS_CHROMEOS) |
+ // When we are doing straight chromeos builds, we still need to handle the |
+ // toplevel window case. |
+ if (params->parent == NULL && params->context == NULL && params->top_level) { |
Ben Goodger (Google)
2013/01/15 18:19:52
!params->parent && !params->context
no braces
|
+ params->context = ash::Shell::GetPrimaryRootWindow(); |
+ } |
+#elif defined(USE_AURA) |
// While the majority of the time, context wasn't plumbed through due to the |
// existence of a global StackingClient, if this window is a toplevel, it's |
// possible that there is no contextual state that we can use. |