| 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.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 #include "base/memory/ptr_util.h" | 123 #include "base/memory/ptr_util.h" |
| 124 #include "base/sys_info.h" | 124 #include "base/sys_info.h" |
| 125 #include "base/threading/sequenced_worker_pool.h" | 125 #include "base/threading/sequenced_worker_pool.h" |
| 126 #include "base/trace_event/trace_event.h" | 126 #include "base/trace_event/trace_event.h" |
| 127 #include "chromeos/audio/audio_a11y_controller.h" | 127 #include "chromeos/audio/audio_a11y_controller.h" |
| 128 #include "chromeos/chromeos_switches.h" | 128 #include "chromeos/chromeos_switches.h" |
| 129 #include "chromeos/dbus/dbus_thread_manager.h" | 129 #include "chromeos/dbus/dbus_thread_manager.h" |
| 130 #include "chromeos/system/devicemode.h" | 130 #include "chromeos/system/devicemode.h" |
| 131 #include "components/prefs/pref_registry_simple.h" | 131 #include "components/prefs/pref_registry_simple.h" |
| 132 #include "components/prefs/pref_service.h" | 132 #include "components/prefs/pref_service.h" |
| 133 #include "components/ui_devtools/devtools_server.h" | |
| 134 #include "components/ui_devtools/views/ui_devtools_css_agent.h" | |
| 135 #include "components/ui_devtools/views/ui_devtools_dom_agent.h" | |
| 136 #include "services/preferences/public/cpp/pref_service_factory.h" | 133 #include "services/preferences/public/cpp/pref_service_factory.h" |
| 137 #include "services/preferences/public/interfaces/preferences.mojom.h" | 134 #include "services/preferences/public/interfaces/preferences.mojom.h" |
| 138 #include "services/service_manager/public/cpp/connector.h" | 135 #include "services/service_manager/public/cpp/connector.h" |
| 139 #include "services/ui/public/interfaces/constants.mojom.h" | 136 #include "services/ui/public/interfaces/constants.mojom.h" |
| 140 #include "ui/app_list/presenter/app_list.h" | 137 #include "ui/app_list/presenter/app_list.h" |
| 141 #include "ui/aura/client/aura_constants.h" | 138 #include "ui/aura/client/aura_constants.h" |
| 142 #include "ui/aura/env.h" | 139 #include "ui/aura/env.h" |
| 143 #include "ui/aura/layout_manager.h" | 140 #include "ui/aura/layout_manager.h" |
| 144 #include "ui/aura/mus/focus_synchronizer.h" | 141 #include "ui/aura/mus/focus_synchronizer.h" |
| 145 #include "ui/aura/mus/user_activity_forwarder.h" | 142 #include "ui/aura/mus/user_activity_forwarder.h" |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 accessibility_delegate_.reset(shell_delegate_->CreateAccessibilityDelegate()); | 845 accessibility_delegate_.reset(shell_delegate_->CreateAccessibilityDelegate()); |
| 849 palette_delegate_ = shell_delegate_->CreatePaletteDelegate(); | 846 palette_delegate_ = shell_delegate_->CreatePaletteDelegate(); |
| 850 toast_manager_ = base::MakeUnique<ToastManager>(); | 847 toast_manager_ = base::MakeUnique<ToastManager>(); |
| 851 | 848 |
| 852 // Install the custom factory early on so that views::FocusManagers for Tray, | 849 // Install the custom factory early on so that views::FocusManagers for Tray, |
| 853 // Shelf, and WallPaper could be created by the factory. | 850 // Shelf, and WallPaper could be created by the factory. |
| 854 views::FocusManagerFactory::Install(new AshFocusManagerFactory); | 851 views::FocusManagerFactory::Install(new AshFocusManagerFactory); |
| 855 | 852 |
| 856 wallpaper_controller_ = base::MakeUnique<WallpaperController>(); | 853 wallpaper_controller_ = base::MakeUnique<WallpaperController>(); |
| 857 | 854 |
| 858 // Start devtools server | |
| 859 devtools_server_ = ui_devtools::UiDevToolsServer::Create(nullptr); | |
| 860 if (devtools_server_) { | |
| 861 auto dom_backend = base::MakeUnique<ui_devtools::UIDevToolsDOMAgent>(); | |
| 862 auto css_backend = | |
| 863 base::MakeUnique<ui_devtools::UIDevToolsCSSAgent>(dom_backend.get()); | |
| 864 auto devtools_client = base::MakeUnique<ui_devtools::UiDevToolsClient>( | |
| 865 "Ash", devtools_server_.get()); | |
| 866 devtools_client->AddAgent(std::move(dom_backend)); | |
| 867 devtools_client->AddAgent(std::move(css_backend)); | |
| 868 devtools_server_->AttachClient(std::move(devtools_client)); | |
| 869 } | |
| 870 | |
| 871 if (config == Config::MASH) | 855 if (config == Config::MASH) |
| 872 app_list_delegate_impl_ = base::MakeUnique<AppListDelegateImpl>(); | 856 app_list_delegate_impl_ = base::MakeUnique<AppListDelegateImpl>(); |
| 873 | 857 |
| 874 // TODO(sky): move creation to ShellPort. | 858 // TODO(sky): move creation to ShellPort. |
| 875 if (config != Config::MASH) | 859 if (config != Config::MASH) |
| 876 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryAsh>(); | 860 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryAsh>(); |
| 877 | 861 |
| 878 window_positioner_ = base::MakeUnique<WindowPositioner>(); | 862 window_positioner_ = base::MakeUnique<WindowPositioner>(); |
| 879 | 863 |
| 880 if (config == Config::CLASSIC) { | 864 if (config == Config::CLASSIC) { |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 void Shell::OnPrefServiceInitialized( | 1271 void Shell::OnPrefServiceInitialized( |
| 1288 std::unique_ptr<::PrefService> pref_service) { | 1272 std::unique_ptr<::PrefService> pref_service) { |
| 1289 if (!instance_) | 1273 if (!instance_) |
| 1290 return; | 1274 return; |
| 1291 // |pref_service_| is null if can't connect to Chrome (as happens when | 1275 // |pref_service_| is null if can't connect to Chrome (as happens when |
| 1292 // running mash outside of chrome --mash and chrome isn't built). | 1276 // running mash outside of chrome --mash and chrome isn't built). |
| 1293 pref_service_ = std::move(pref_service); | 1277 pref_service_ = std::move(pref_service); |
| 1294 } | 1278 } |
| 1295 | 1279 |
| 1296 } // namespace ash | 1280 } // namespace ash |
| OLD | NEW |