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.h" | 9 #include "base/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
14 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
15 #include "content/shell/shell_browser_context.h" | 15 #include "content/shell/shell_browser_context.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 #include "ui/views/examples/examples_window_with_content.h" | 17 #include "ui/views/examples/examples_window_with_content.h" |
18 #include "ui/views/focus/accelerator_handler.h" | 18 #include "ui/views/focus/accelerator_handler.h" |
19 #include "ui/views/test/desktop_test_views_delegate.h" | 19 #include "ui/views/test/desktop_test_views_delegate.h" |
20 | 20 |
21 #if defined(USE_AURA) | 21 #if defined(USE_AURA) |
22 #include "ui/aura/env.h" | 22 #include "ui/aura/env.h" |
23 #include "ui/aura/single_display_manager.h" | |
24 #include "ui/gfx/screen.h" | 23 #include "ui/gfx/screen.h" |
25 #include "ui/views/widget/desktop_aura/desktop_screen.h" | 24 #include "ui/views/widget/desktop_aura/desktop_screen.h" |
26 #include "ui/views/widget/desktop_aura/desktop_stacking_client.h" | 25 #include "ui/views/widget/desktop_aura/desktop_stacking_client.h" |
27 #include "ui/views/widget/native_widget_aura.h" | 26 #include "ui/views/widget/native_widget_aura.h" |
28 #endif | 27 #endif |
29 | 28 |
30 namespace views { | 29 namespace views { |
31 namespace examples { | 30 namespace examples { |
32 | 31 |
33 ExamplesBrowserMainParts::ExamplesBrowserMainParts( | 32 ExamplesBrowserMainParts::ExamplesBrowserMainParts( |
34 const content::MainFunctionParams& parameters) { | 33 const content::MainFunctionParams& parameters) { |
35 } | 34 } |
36 | 35 |
37 ExamplesBrowserMainParts::~ExamplesBrowserMainParts() { | 36 ExamplesBrowserMainParts::~ExamplesBrowserMainParts() { |
38 } | 37 } |
39 | 38 |
40 void ExamplesBrowserMainParts::PreMainMessageLoopRun() { | 39 void ExamplesBrowserMainParts::PreMainMessageLoopRun() { |
41 browser_context_.reset(new content::ShellBrowserContext(false)); | 40 browser_context_.reset(new content::ShellBrowserContext(false)); |
42 | 41 |
43 #if defined(USE_AURA) | 42 #if !defined(OS_CHROMEOS) && defined(USE_AURA) |
44 aura::Env::GetInstance()->SetDisplayManager(new aura::SingleDisplayManager); | |
45 stacking_client_.reset(new DesktopStackingClient); | 43 stacking_client_.reset(new DesktopStackingClient); |
46 aura::client::SetStackingClient(stacking_client_.get()); | 44 aura::client::SetStackingClient(stacking_client_.get()); |
47 gfx::Screen::SetScreenInstance( | 45 gfx::Screen::SetScreenInstance( |
48 gfx::SCREEN_TYPE_NATIVE, CreateDesktopScreen()); | 46 gfx::SCREEN_TYPE_NATIVE, CreateDesktopScreen()); |
49 #endif | 47 #endif |
50 views_delegate_.reset(new DesktopTestViewsDelegate); | 48 views_delegate_.reset(new DesktopTestViewsDelegate); |
51 | 49 |
52 ShowExamplesWindowWithContent(QUIT_ON_CLOSE, browser_context_.get()); | 50 ShowExamplesWindowWithContent(QUIT_ON_CLOSE, browser_context_.get()); |
53 } | 51 } |
54 | 52 |
(...skipping 13 matching lines...) Expand all Loading... |
68 base::RunLoop run_loop(&accelerator_handler); | 66 base::RunLoop run_loop(&accelerator_handler); |
69 #else | 67 #else |
70 base::RunLoop run_loop; | 68 base::RunLoop run_loop; |
71 #endif | 69 #endif |
72 run_loop.Run(); | 70 run_loop.Run(); |
73 return true; | 71 return true; |
74 } | 72 } |
75 | 73 |
76 } // namespace examples | 74 } // namespace examples |
77 } // namespace views | 75 } // namespace views |
OLD | NEW |