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 std::unique_ptr<aura::WindowTreeClient> window_tree_client = | 72 std::unique_ptr<aura::WindowTreeClient> window_tree_client = |
71 base::MakeUnique<aura::WindowTreeClient>(connector, window_manager.get(), | 73 base::MakeUnique<aura::WindowTreeClient>(connector, window_manager.get(), |
72 window_manager.get()); | 74 window_manager.get()); |
73 window_tree_client->ConnectAsWindowManager(); | 75 window_tree_client->ConnectAsWindowManager(); |
74 aura::Env::GetInstance()->SetWindowTreeClient(window_tree_client.get()); | 76 aura::Env::GetInstance()->SetWindowTreeClient(window_tree_client.get()); |
75 window_manager->Init(std::move(window_tree_client), | 77 window_manager->Init(std::move(window_tree_client), |
76 content::BrowserThread::GetBlockingPool(), | 78 content::BrowserThread::GetBlockingPool(), |
77 base::MakeUnique<ChromeShellDelegate>()); | 79 base::MakeUnique<ChromeShellDelegate>()); |
78 CHECK(window_manager->WaitForInitialDisplays()); | 80 CHECK(window_manager->WaitForInitialDisplays()); |
79 return window_manager; | 81 return window_manager; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 154 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
153 } | 155 } |
154 | 156 |
155 AshInit::~AshInit() { | 157 AshInit::~AshInit() { |
156 // |window_manager_| deletes the Shell. | 158 // |window_manager_| deletes the Shell. |
157 if (!window_manager_ && ash::Shell::HasInstance()) { | 159 if (!window_manager_ && ash::Shell::HasInstance()) { |
158 ash::Shell::DeleteInstance(); | 160 ash::Shell::DeleteInstance(); |
159 ash::ShellContentState::DestroyInstance(); | 161 ash::ShellContentState::DestroyInstance(); |
160 } | 162 } |
161 } | 163 } |
OLD | NEW |