| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/mus/window_manager_application.h" | 5 #include "ash/mus/window_manager_application.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/mojo_interface_factory.h" | 9 #include "ash/mojo_interface_factory.h" |
| 10 #include "ash/mus/network_connect_delegate_mus.h" | 10 #include "ash/mus/network_connect_delegate_mus.h" |
| 11 #include "ash/mus/window_manager.h" | 11 #include "ash/mus/window_manager.h" |
| 12 #include "ash/public/cpp/config.h" | 12 #include "ash/public/cpp/config.h" |
| 13 #include "ash/shell.h" |
| 13 #include "ash/shell_delegate.h" | 14 #include "ash/shell_delegate.h" |
| 14 #include "ash/system/power/power_status.h" | 15 #include "ash/system/power/power_status.h" |
| 15 #include "base/bind.h" | 16 #include "base/bind.h" |
| 16 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
| 17 #include "base/threading/sequenced_worker_pool.h" | 18 #include "base/threading/sequenced_worker_pool.h" |
| 18 #include "base/threading/thread_task_runner_handle.h" | 19 #include "base/threading/thread_task_runner_handle.h" |
| 19 #include "chromeos/audio/cras_audio_handler.h" | 20 #include "chromeos/audio/cras_audio_handler.h" |
| 20 #include "chromeos/cryptohome/system_salt_getter.h" | 21 #include "chromeos/cryptohome/system_salt_getter.h" |
| 21 #include "chromeos/dbus/dbus_thread_manager.h" | 22 #include "chromeos/dbus/dbus_thread_manager.h" |
| 22 #include "chromeos/network/network_connect.h" | 23 #include "chromeos/network/network_connect.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 context()->connector(), context()->identity(), "ash_mus_resources.pak", | 143 context()->connector(), context()->identity(), "ash_mus_resources.pak", |
| 143 "ash_mus_resources_200.pak", nullptr, | 144 "ash_mus_resources_200.pak", nullptr, |
| 144 views::AuraInit::Mode::AURA_MUS_WINDOW_MANAGER); | 145 views::AuraInit::Mode::AURA_MUS_WINDOW_MANAGER); |
| 145 window_manager_ = base::MakeUnique<WindowManager>( | 146 window_manager_ = base::MakeUnique<WindowManager>( |
| 146 context()->connector(), ash_config_, show_primary_host_on_connect_); | 147 context()->connector(), ash_config_, show_primary_host_on_connect_); |
| 147 | 148 |
| 148 std::unique_ptr<aura::WindowTreeClient> window_tree_client = | 149 std::unique_ptr<aura::WindowTreeClient> window_tree_client = |
| 149 base::MakeUnique<aura::WindowTreeClient>( | 150 base::MakeUnique<aura::WindowTreeClient>( |
| 150 context()->connector(), window_manager_.get(), window_manager_.get()); | 151 context()->connector(), window_manager_.get(), window_manager_.get()); |
| 151 const bool automatically_create_display_roots = | 152 const bool automatically_create_display_roots = |
| 152 window_manager_->config() == Config::MASH; | 153 !Shell::ShouldEnableSimplifiedDisplayManagement( |
| 154 window_manager_->config()); |
| 153 window_tree_client->ConnectAsWindowManager( | 155 window_tree_client->ConnectAsWindowManager( |
| 154 automatically_create_display_roots); | 156 automatically_create_display_roots); |
| 155 | 157 |
| 156 const size_t kMaxNumberThreads = 3u; // Matches that of content. | 158 const size_t kMaxNumberThreads = 3u; // Matches that of content. |
| 157 const char kThreadNamePrefix[] = "MashBlocking"; | 159 const char kThreadNamePrefix[] = "MashBlocking"; |
| 158 blocking_pool_ = new base::SequencedWorkerPool( | 160 blocking_pool_ = new base::SequencedWorkerPool( |
| 159 kMaxNumberThreads, kThreadNamePrefix, base::TaskPriority::USER_VISIBLE); | 161 kMaxNumberThreads, kThreadNamePrefix, base::TaskPriority::USER_VISIBLE); |
| 160 const bool init_network_handler = true; | 162 const bool init_network_handler = true; |
| 161 InitWindowManager(std::move(window_tree_client), blocking_pool_, | 163 InitWindowManager(std::move(window_tree_client), blocking_pool_, |
| 162 init_network_handler); | 164 init_network_handler); |
| 163 } | 165 } |
| 164 | 166 |
| 165 void WindowManagerApplication::OnBindInterface( | 167 void WindowManagerApplication::OnBindInterface( |
| 166 const service_manager::BindSourceInfo& source_info, | 168 const service_manager::BindSourceInfo& source_info, |
| 167 const std::string& interface_name, | 169 const std::string& interface_name, |
| 168 mojo::ScopedMessagePipeHandle interface_pipe) { | 170 mojo::ScopedMessagePipeHandle interface_pipe) { |
| 169 registry_.BindInterface(source_info, interface_name, | 171 registry_.BindInterface(source_info, interface_name, |
| 170 std::move(interface_pipe)); | 172 std::move(interface_pipe)); |
| 171 } | 173 } |
| 172 | 174 |
| 173 } // namespace mus | 175 } // namespace mus |
| 174 } // namespace ash | 176 } // namespace ash |
| OLD | NEW |