OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/examples/content_client/examples_browser_main_parts.h" | 5 #include "ui/views/examples/content_client/examples_browser_main_parts.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #if defined(OS_CHROMEOS) | 53 #if defined(OS_CHROMEOS) |
54 gfx::Screen::SetScreenInstance( | 54 gfx::Screen::SetScreenInstance( |
55 gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create()); | 55 gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create()); |
56 // Set up basic pieces of views::corewm. | 56 // Set up basic pieces of views::corewm. |
57 wm_test_helper_.reset(new wm::WMTestHelper(gfx::Size(800, 600))); | 57 wm_test_helper_.reset(new wm::WMTestHelper(gfx::Size(800, 600))); |
58 // Ensure the X window gets mapped. | 58 // Ensure the X window gets mapped. |
59 wm_test_helper_->host()->Show(); | 59 wm_test_helper_->host()->Show(); |
60 // Ensure Aura knows where to open new windows. | 60 // Ensure Aura knows where to open new windows. |
61 window_context = wm_test_helper_->host()->window(); | 61 window_context = wm_test_helper_->host()->window(); |
62 #else | 62 #else |
63 aura::Env::CreateInstance(); | 63 aura::Env::CreateInstance(true); |
64 gfx::Screen::SetScreenInstance( | 64 gfx::Screen::SetScreenInstance( |
65 gfx::SCREEN_TYPE_NATIVE, CreateDesktopScreen()); | 65 gfx::SCREEN_TYPE_NATIVE, CreateDesktopScreen()); |
66 #endif | 66 #endif |
67 views_delegate_.reset(new DesktopTestViewsDelegate); | 67 views_delegate_.reset(new DesktopTestViewsDelegate); |
68 | 68 |
69 ShowExamplesWindowWithContent( | 69 ShowExamplesWindowWithContent( |
70 QUIT_ON_CLOSE, browser_context_.get(), window_context); | 70 QUIT_ON_CLOSE, browser_context_.get(), window_context); |
71 } | 71 } |
72 | 72 |
73 void ExamplesBrowserMainParts::PostMainMessageLoopRun() { | 73 void ExamplesBrowserMainParts::PostMainMessageLoopRun() { |
74 browser_context_.reset(); | 74 browser_context_.reset(); |
75 #if defined(OS_CHROMEOS) | 75 #if defined(OS_CHROMEOS) |
76 wm_test_helper_.reset(); | 76 wm_test_helper_.reset(); |
77 #endif | 77 #endif |
78 views_delegate_.reset(); | 78 views_delegate_.reset(); |
79 aura::Env::DeleteInstance(); | 79 aura::Env::DeleteInstance(); |
80 } | 80 } |
81 | 81 |
82 bool ExamplesBrowserMainParts::MainMessageLoopRun(int* result_code) { | 82 bool ExamplesBrowserMainParts::MainMessageLoopRun(int* result_code) { |
83 base::RunLoop run_loop; | 83 base::RunLoop run_loop; |
84 run_loop.Run(); | 84 run_loop.Run(); |
85 return true; | 85 return true; |
86 } | 86 } |
87 | 87 |
88 } // namespace examples | 88 } // namespace examples |
89 } // namespace views | 89 } // namespace views |
OLD | NEW |