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 "ash/shell/content_client/shell_browser_main_parts.h" | 5 #include "ash/shell/content_client/shell_browser_main_parts.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/desktop_background/desktop_background_controller.h" | 8 #include "ash/desktop_background/desktop_background_controller.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell/shell_delegate_impl.h" | 10 #include "ash/shell/shell_delegate_impl.h" |
11 #include "ash/shell/window_watcher.h" | 11 #include "ash/shell/window_watcher.h" |
12 #include "ash/shell_init_params.h" | 12 #include "ash/shell_init_params.h" |
13 #include "ash/system/user/login_status.h" | 13 #include "ash/system/user/login_status.h" |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/i18n/icu_util.h" | 16 #include "base/i18n/icu_util.h" |
17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "base/threading/thread.h" | 19 #include "base/threading/thread.h" |
20 #include "base/threading/thread_restrictions.h" | 20 #include "base/threading/thread_restrictions.h" |
| 21 #include "content/public/browser/context_factory.h" |
21 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
22 #include "content/shell/browser/shell_browser_context.h" | 23 #include "content/shell/browser/shell_browser_context.h" |
23 #include "content/shell/browser/shell_net_log.h" | 24 #include "content/shell/browser/shell_net_log.h" |
24 #include "net/base/net_module.h" | 25 #include "net/base/net_module.h" |
25 #include "ui/aura/env.h" | 26 #include "ui/aura/env.h" |
26 #include "ui/aura/window.h" | 27 #include "ui/aura/window.h" |
27 #include "ui/aura/window_tree_host.h" | 28 #include "ui/aura/window_tree_host.h" |
28 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
29 #include "ui/base/ui_base_paths.h" | 30 #include "ui/base/ui_base_paths.h" |
30 #include "ui/compositor/compositor.h" | 31 #include "ui/compositor/compositor.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 void ShellBrowserMainParts::ToolkitInitialized() { | 102 void ShellBrowserMainParts::ToolkitInitialized() { |
102 wm_state_.reset(new wm::WMState); | 103 wm_state_.reset(new wm::WMState); |
103 } | 104 } |
104 | 105 |
105 void ShellBrowserMainParts::PreMainMessageLoopRun() { | 106 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
106 net_log_.reset(new content::ShellNetLog("ash_shell")); | 107 net_log_.reset(new content::ShellNetLog("ash_shell")); |
107 browser_context_.reset(new content::ShellBrowserContext( | 108 browser_context_.reset(new content::ShellBrowserContext( |
108 false, net_log_.get())); | 109 false, net_log_.get())); |
109 | 110 |
110 // A ViewsDelegate is required. | 111 // A ViewsDelegate is required. |
111 if (!views::ViewsDelegate::views_delegate) | 112 if (!views::ViewsDelegate::views_delegate) { |
112 views::ViewsDelegate::views_delegate = new ShellViewsDelegate; | 113 ShellViewsDelegate* views_delegate = new ShellViewsDelegate; |
| 114 views_delegate->set_context_factory(content::GetContextFactory()); |
| 115 } |
113 | 116 |
114 delegate_ = new ash::shell::ShellDelegateImpl; | 117 delegate_ = new ash::shell::ShellDelegateImpl; |
115 // The global message center state must be initialized absent | 118 // The global message center state must be initialized absent |
116 // g_browser_process. | 119 // g_browser_process. |
117 message_center::MessageCenter::Initialize(); | 120 message_center::MessageCenter::Initialize(); |
118 | 121 |
119 #if defined(OS_CHROMEOS) | 122 #if defined(OS_CHROMEOS) |
120 // Create CrasAudioHandler for testing since g_browser_process | 123 // Create CrasAudioHandler for testing since g_browser_process |
121 // is absent. | 124 // is absent. |
122 chromeos::CrasAudioHandler::InitializeForTesting(); | 125 chromeos::CrasAudioHandler::InitializeForTesting(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 browser_context_.reset(); | 168 browser_context_.reset(); |
166 } | 169 } |
167 | 170 |
168 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { | 171 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { |
169 base::MessageLoopForUI::current()->Run(); | 172 base::MessageLoopForUI::current()->Run(); |
170 return true; | 173 return true; |
171 } | 174 } |
172 | 175 |
173 } // namespace shell | 176 } // namespace shell |
174 } // namespace ash | 177 } // namespace ash |
OLD | NEW |