| 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/common/login_status.h" | 7 #include "ash/common/login_status.h" |
| 8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "ash/content/shell_content_state.h" | 9 #include "ash/content/shell_content_state.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/shell/content/shell_content_state_impl.h" | 11 #include "ash/shell/content/shell_content_state_impl.h" |
| 12 #include "ash/shell/example_app_list_presenter.h" | 12 #include "ash/shell/example_app_list_presenter.h" |
| 13 #include "ash/shell/example_session_controller_client.h" |
| 13 #include "ash/shell/shell_delegate_impl.h" | 14 #include "ash/shell/shell_delegate_impl.h" |
| 14 #include "ash/shell/window_watcher.h" | 15 #include "ash/shell/window_watcher.h" |
| 15 #include "ash/shell_init_params.h" | 16 #include "ash/shell_init_params.h" |
| 16 #include "base/bind.h" | 17 #include "base/bind.h" |
| 17 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 18 #include "base/i18n/icu_util.h" | 19 #include "base/i18n/icu_util.h" |
| 19 #include "base/message_loop/message_loop.h" | 20 #include "base/message_loop/message_loop.h" |
| 20 #include "base/run_loop.h" | 21 #include "base/run_loop.h" |
| 21 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
| 22 #include "base/threading/thread.h" | 23 #include "base/threading/thread.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 125 |
| 125 ShellContentState::SetInstance( | 126 ShellContentState::SetInstance( |
| 126 new ShellContentStateImpl(browser_context_.get())); | 127 new ShellContentStateImpl(browser_context_.get())); |
| 127 ui::MaterialDesignController::Initialize(); | 128 ui::MaterialDesignController::Initialize(); |
| 128 ash::ShellInitParams init_params; | 129 ash::ShellInitParams init_params; |
| 129 init_params.delegate = delegate_; | 130 init_params.delegate = delegate_; |
| 130 init_params.context_factory = content::GetContextFactory(); | 131 init_params.context_factory = content::GetContextFactory(); |
| 131 init_params.context_factory_private = content::GetContextFactoryPrivate(); | 132 init_params.context_factory_private = content::GetContextFactoryPrivate(); |
| 132 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); | 133 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); |
| 133 ash::Shell::CreateInstance(init_params); | 134 ash::Shell::CreateInstance(init_params); |
| 135 |
| 136 // Initialize session controller client and create fake sessions before |
| 137 // creating shelf. |
| 138 example_session_controller_client_ = |
| 139 base::MakeUnique<ExampleSessionControllerClient>( |
| 140 WmShell::Get()->session_controller()); |
| 141 example_session_controller_client_->Initialize(); |
| 142 |
| 134 ash::WmShell::Get()->CreateShelfView(); | 143 ash::WmShell::Get()->CreateShelfView(); |
| 135 ash::WmShell::Get()->UpdateAfterLoginStatusChange(LoginStatus::USER); | 144 ash::WmShell::Get()->UpdateAfterLoginStatusChange(LoginStatus::USER); |
| 136 | 145 |
| 137 window_watcher_.reset(new ash::shell::WindowWatcher); | 146 window_watcher_.reset(new ash::shell::WindowWatcher); |
| 138 display::Screen::GetScreen()->AddObserver(window_watcher_.get()); | 147 display::Screen::GetScreen()->AddObserver(window_watcher_.get()); |
| 139 | 148 |
| 140 ash::shell::InitWindowTypeLauncher(); | 149 ash::shell::InitWindowTypeLauncher(); |
| 141 | 150 |
| 142 // Initialize the example app list presenter. | 151 // Initialize the example app list presenter. |
| 143 example_app_list_presenter_ = base::MakeUnique<ExampleAppListPresenter>(); | 152 example_app_list_presenter_ = base::MakeUnique<ExampleAppListPresenter>(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 169 browser_context_.reset(); | 178 browser_context_.reset(); |
| 170 } | 179 } |
| 171 | 180 |
| 172 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { | 181 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 173 base::RunLoop().Run(); | 182 base::RunLoop().Run(); |
| 174 return true; | 183 return true; |
| 175 } | 184 } |
| 176 | 185 |
| 177 } // namespace shell | 186 } // namespace shell |
| 178 } // namespace ash | 187 } // namespace ash |
| OLD | NEW |