OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/views_content_client/views_content_client_main_parts.h" |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" |
| 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/threading/thread.h" |
| 13 #include "base/threading/thread_restrictions.h" |
| 14 #include "content/public/browser/context_factory.h" |
| 15 #include "content/public/common/content_switches.h" |
| 16 #include "content/shell/browser/shell_browser_context.h" |
| 17 #include "ui/aura/env.h" |
| 18 #include "ui/base/ime/input_method_initializer.h" |
| 19 #include "ui/gfx/screen.h" |
| 20 #include "ui/views/test/desktop_test_views_delegate.h" |
| 21 #include "ui/views/widget/native_widget_aura.h" |
| 22 #include "ui/views_content_client/views_content_client.h" |
| 23 #include "ui/wm/core/wm_state.h" |
| 24 |
| 25 #include "ui/views/widget/desktop_aura/desktop_screen.h" |
| 26 |
| 27 namespace ui { |
| 28 |
| 29 namespace { |
| 30 |
| 31 class ViewsContentClientMainPartsDesktopAura |
| 32 : public ViewsContentClientMainPartsAura { |
| 33 public: |
| 34 ViewsContentClientMainPartsDesktopAura( |
| 35 const content::MainFunctionParams& content_params, |
| 36 ViewsContentClient* views_content_client); |
| 37 virtual ~ViewsContentClientMainPartsDesktopAura() {} |
| 38 |
| 39 // content::BrowserMainParts: |
| 40 virtual void PreMainMessageLoopRun() OVERRIDE; |
| 41 |
| 42 private: |
| 43 DISALLOW_COPY_AND_ASSIGN(ViewsContentClientMainPartsDesktopAura); |
| 44 }; |
| 45 |
| 46 ViewsContentClientMainPartsDesktopAura::ViewsContentClientMainPartsDesktopAura( |
| 47 const content::MainFunctionParams& content_params, |
| 48 ViewsContentClient* views_content_client) |
| 49 : ViewsContentClientMainPartsAura(content_params, views_content_client) { |
| 50 } |
| 51 |
| 52 void ViewsContentClientMainParts::PreMainMessageLoopRun() { |
| 53 ViewsContentClientMainPartsAura::PreMainMessageLoopRun(); |
| 54 |
| 55 aura::Env::CreateInstance(true); |
| 56 gfx::Screen::SetScreenInstance( |
| 57 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); |
| 58 |
| 59 views_content_client()->task().Run(browser_context(), NULL); |
| 60 } |
| 61 |
| 62 } // namespace |
| 63 |
| 64 } // namespace ui |
OLD | NEW |