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 "chrome/browser/ui/ash/ash_init.h" | 5 #include "chrome/browser/ui/ash/ash_init.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
8 #include "ash/accelerators/accelerator_controller_delegate_aura.h" | 8 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
9 #include "ash/accessibility_types.h" | 9 #include "ash/accessibility_types.h" |
10 #include "ash/aura/shell_port_classic.h" | 10 #include "ash/aura/shell_port_classic.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 shell_init_params.context_factory_private = | 58 shell_init_params.context_factory_private = |
59 content::GetContextFactoryPrivate(); | 59 content::GetContextFactoryPrivate(); |
60 shell_init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); | 60 shell_init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); |
61 | 61 |
62 ash::Shell::CreateInstance(shell_init_params); | 62 ash::Shell::CreateInstance(shell_init_params); |
63 } | 63 } |
64 | 64 |
65 std::unique_ptr<ash::mus::WindowManager> CreateMusShell() { | 65 std::unique_ptr<ash::mus::WindowManager> CreateMusShell() { |
66 service_manager::Connector* connector = | 66 service_manager::Connector* connector = |
67 content::ServiceManagerConnection::GetForProcess()->GetConnector(); | 67 content::ServiceManagerConnection::GetForProcess()->GetConnector(); |
| 68 const bool show_primary_host_on_connect = true; |
68 std::unique_ptr<ash::mus::WindowManager> window_manager = | 69 std::unique_ptr<ash::mus::WindowManager> window_manager = |
69 base::MakeUnique<ash::mus::WindowManager>(connector, ash::Config::MUS); | 70 base::MakeUnique<ash::mus::WindowManager>(connector, ash::Config::MUS, |
| 71 show_primary_host_on_connect); |
70 // The WindowManager normally deletes the Shell when it loses its connection | 72 // The WindowManager normally deletes the Shell when it loses its connection |
71 // to mus. Disable that by installing an empty callback. Chrome installs | 73 // to mus. Disable that by installing an empty callback. Chrome installs |
72 // its own callback to detect when the connection to mus is lost and that is | 74 // its own callback to detect when the connection to mus is lost and that is |
73 // what shuts everything down. | 75 // what shuts everything down. |
74 window_manager->SetLostConnectionCallback(base::BindOnce(&base::DoNothing)); | 76 window_manager->SetLostConnectionCallback(base::BindOnce(&base::DoNothing)); |
75 std::unique_ptr<aura::WindowTreeClient> window_tree_client = | 77 std::unique_ptr<aura::WindowTreeClient> window_tree_client = |
76 base::MakeUnique<aura::WindowTreeClient>(connector, window_manager.get(), | 78 base::MakeUnique<aura::WindowTreeClient>(connector, window_manager.get(), |
77 window_manager.get()); | 79 window_manager.get()); |
78 window_tree_client->ConnectAsWindowManager(); | 80 const bool automatically_create_display_roots = false; |
| 81 window_tree_client->ConnectAsWindowManager( |
| 82 automatically_create_display_roots); |
79 aura::Env::GetInstance()->SetWindowTreeClient(window_tree_client.get()); | 83 aura::Env::GetInstance()->SetWindowTreeClient(window_tree_client.get()); |
80 window_manager->Init(std::move(window_tree_client), | 84 window_manager->Init(std::move(window_tree_client), |
81 content::BrowserThread::GetBlockingPool(), | 85 content::BrowserThread::GetBlockingPool(), |
82 base::MakeUnique<ChromeShellDelegate>()); | 86 base::MakeUnique<ChromeShellDelegate>()); |
83 CHECK(window_manager->WaitForInitialDisplays()); | 87 CHECK(window_manager->WaitForInitialDisplays()); |
84 return window_manager; | 88 return window_manager; |
85 } | 89 } |
86 | 90 |
87 } // namespace | 91 } // namespace |
88 | 92 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 161 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
158 } | 162 } |
159 | 163 |
160 AshInit::~AshInit() { | 164 AshInit::~AshInit() { |
161 // |window_manager_| deletes the Shell. | 165 // |window_manager_| deletes the Shell. |
162 if (!window_manager_ && ash::Shell::HasInstance()) { | 166 if (!window_manager_ && ash::Shell::HasInstance()) { |
163 ash::Shell::DeleteInstance(); | 167 ash::Shell::DeleteInstance(); |
164 ash::ShellContentState::DestroyInstance(); | 168 ash::ShellContentState::DestroyInstance(); |
165 } | 169 } |
166 } | 170 } |
OLD | NEW |