Index: chrome/browser/browser_main.cc |
=================================================================== |
--- chrome/browser/browser_main.cc (revision 89890) |
+++ chrome/browser/browser_main.cc (working copy) |
@@ -114,6 +114,7 @@ |
#include "ui/base/resource/resource_bundle.h" |
#include "ui/gfx/gl/gl_implementation.h" |
#include "ui/gfx/gl/gl_switches.h" |
+#include "views/desktop/desktop_window.h" |
#if defined(USE_LINUX_BREAKPAD) |
#include "base/linux_util.h" |
@@ -1380,6 +1381,18 @@ |
RegisterTranslateableItems(); |
#endif |
+#if defined(TOOLKIT_VIEWS) |
+ // Launch the views desktop shell window and register it as the default parent |
+ // for all unparented views widgets. |
+ if (parsed_command_line.HasSwitch(switches::kViewsDesktop)) { |
+ views::desktop::DesktopWindow::CreateDesktopWindow(); |
+ ChromeViewsDelegate* chrome_views_delegate = |
+ static_cast<ChromeViewsDelegate*>(views::ViewsDelegate::views_delegate); |
+ chrome_views_delegate->default_parent_view = |
+ views::desktop::DesktopWindow::desktop_window; |
+ } |
+#endif |
+ |
BrowserInit browser_init; |
// On first run, we need to process the predictor preferences before the |