Index: content/shell/shell_aura.cc |
diff --git a/content/shell/shell_aura.cc b/content/shell/shell_aura.cc |
index a0986c47192f0faab60f726e00ee5c95152a4285..be2a8b6269251d88ccd197376ba4a060e6d4852d 100644 |
--- a/content/shell/shell_aura.cc |
+++ b/content/shell/shell_aura.cc |
@@ -283,9 +283,12 @@ void Shell::PlatformInitialize() { |
chromeos::DBusThreadManager::Initialize(); |
#endif |
#if defined(OS_CHROMEOS) |
- stacking_client_ = new content::ShellStackingClientAsh(); |
gfx::Screen::SetScreenInstance( |
gfx::SCREEN_TYPE_NATIVE, new aura::TestScreen); |
+ scoped_ptr<aura::RootWindow> root_window = |
+ CreateRootWindow(kTestWindowWidth, kTestWindowHeight); |
+ stacking_client_ = |
+ new content::ShellStackingClientAsh(root_window.Pass()); |
#else |
stacking_client_ = new views::DesktopStackingClient(); |
gfx::Screen::SetScreenInstance( |
@@ -295,6 +298,14 @@ void Shell::PlatformInitialize() { |
views_delegate_ = new ShellViewsDelegateAura(); |
} |
+// static |
+scoped_ptr<aura::RootWindow> Shell::CreateRootWindow(int width, int height) { |
+ scoped_ptr<aura::RootWindow> root_window(new aura::RootWindow( |
+ aura::RootWindow::CreateParams(gfx::Rect(0, 0, width, height)))); |
+ root_window->Init(); |
+ return root_window.Pass(); |
+} |
+ |
void Shell::PlatformExit() { |
if (stacking_client_) |
delete stacking_client_; |
@@ -335,9 +346,16 @@ void Shell::PlatformSetIsLoading(bool loading) { |
void Shell::PlatformCreateWindow(int width, int height) { |
window_widget_ = |
- views::Widget::CreateWindowWithBounds(new ShellWindowDelegateView(this), |
- gfx::Rect(0, 0, width, height)); |
+ views::Widget::CreateWindowWithContextAndBounds( |
+ new ShellWindowDelegateView(this), |
+ Shell::stacking_client_->GetDefaultParent( |
+ NULL, NULL, gfx::Rect()), |
+ gfx::Rect(0, 0, width, height)); |
window_ = window_widget_->GetNativeWindow(); |
+ // RootWindow created via CreateRootWindow doesn't get a |
+ // ShowRootWindow call, hence its XWindow doesn't get mapped. |
+ // Explicitly call the ShowRootWindow on RootWindow for now. |
+ window_->GetRootWindow()->ShowRootWindow(); |
window_widget_->Show(); |
} |