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/views/chrome_browser_main_extra_parts_views.h" | 5 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" | 10 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" |
11 #include "chrome/browser/ui/views/chrome_views_delegate.h" | 11 #include "chrome/browser/ui/views/chrome_views_delegate.h" |
12 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" | 12 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" |
13 #include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h" | 13 #include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h" |
14 #include "components/constrained_window/constrained_window_views.h" | 14 #include "components/constrained_window/constrained_window_views.h" |
15 | 15 |
16 #if defined(USE_AURA) | 16 #if defined(USE_AURA) |
17 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
18 #include "components/ui_devtools/devtools_server.h" | 18 #include "components/ui_devtools/devtools_server.h" |
19 #include "components/ui_devtools/views/ui_devtools_css_agent.h" | 19 #include "components/ui_devtools/views/ui_devtools_css_agent.h" |
20 #include "components/ui_devtools/views/ui_devtools_dom_agent.h" | 20 #include "components/ui_devtools/views/ui_devtools_dom_agent.h" |
| 21 #include "components/ui_devtools/views/ui_devtools_overlay_agent.h" |
21 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
22 #include "content/public/common/service_manager_connection.h" | 23 #include "content/public/common/service_manager_connection.h" |
23 #include "services/service_manager/public/cpp/connector.h" | 24 #include "services/service_manager/public/cpp/connector.h" |
24 #include "services/service_manager/runner/common/client_util.h" | 25 #include "services/service_manager/runner/common/client_util.h" |
25 #include "services/ui/public/cpp/gpu/gpu.h" // nogncheck | 26 #include "services/ui/public/cpp/gpu/gpu.h" // nogncheck |
26 #include "services/ui/public/cpp/input_devices/input_device_client.h" | 27 #include "services/ui/public/cpp/input_devices/input_device_client.h" |
27 #include "services/ui/public/interfaces/constants.mojom.h" | 28 #include "services/ui/public/interfaces/constants.mojom.h" |
28 #include "services/ui/public/interfaces/input_devices/input_device_server.mojom.
h" | 29 #include "services/ui/public/interfaces/input_devices/input_device_server.mojom.
h" |
29 #include "ui/display/screen.h" | 30 #include "ui/display/screen.h" |
30 #include "ui/views/mus/mus_client.h" | 31 #include "ui/views/mus/mus_client.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 void ChromeBrowserMainExtraPartsViews::PreProfileInit() { | 104 void ChromeBrowserMainExtraPartsViews::PreProfileInit() { |
104 #if defined(USE_AURA) | 105 #if defined(USE_AURA) |
105 // IME driver must be available at login screen, so initialize before profile. | 106 // IME driver must be available at login screen, so initialize before profile. |
106 if (service_manager::ServiceManagerIsRemote()) | 107 if (service_manager::ServiceManagerIsRemote()) |
107 IMEDriver::Register(); | 108 IMEDriver::Register(); |
108 | 109 |
109 // Start devtools server | 110 // Start devtools server |
110 devtools_server_ = ui_devtools::UiDevToolsServer::Create(nullptr); | 111 devtools_server_ = ui_devtools::UiDevToolsServer::Create(nullptr); |
111 if (devtools_server_) { | 112 if (devtools_server_) { |
112 auto dom_backend = base::MakeUnique<ui_devtools::UIDevToolsDOMAgent>(); | 113 auto dom_backend = base::MakeUnique<ui_devtools::UIDevToolsDOMAgent>(); |
| 114 auto overlay_backend = |
| 115 base::MakeUnique<ui_devtools::UIDevToolsOverlayAgent>( |
| 116 dom_backend.get()); |
113 auto css_backend = | 117 auto css_backend = |
114 base::MakeUnique<ui_devtools::UIDevToolsCSSAgent>(dom_backend.get()); | 118 base::MakeUnique<ui_devtools::UIDevToolsCSSAgent>(dom_backend.get()); |
115 auto devtools_client = base::MakeUnique<ui_devtools::UiDevToolsClient>( | 119 auto devtools_client = base::MakeUnique<ui_devtools::UiDevToolsClient>( |
116 "UiDevToolsClient", devtools_server_.get()); | 120 "UiDevToolsClient", devtools_server_.get()); |
117 devtools_client->AddAgent(std::move(dom_backend)); | 121 devtools_client->AddAgent(std::move(dom_backend)); |
118 devtools_client->AddAgent(std::move(css_backend)); | 122 devtools_client->AddAgent(std::move(css_backend)); |
| 123 devtools_client->AddAgent(std::move(overlay_backend)); |
119 devtools_server_->AttachClient(std::move(devtools_client)); | 124 devtools_server_->AttachClient(std::move(devtools_client)); |
120 } | 125 } |
121 #endif | 126 #endif |
122 | 127 |
123 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 128 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
124 // On the Linux desktop, we want to prevent the user from logging in as root, | 129 // On the Linux desktop, we want to prevent the user from logging in as root, |
125 // so that we don't destroy the profile. Now that we have some minimal ui | 130 // so that we don't destroy the profile. Now that we have some minimal ui |
126 // initialized, check to see if we're running as root and bail if we are. | 131 // initialized, check to see if we're running as root and bail if we are. |
127 if (geteuid() != 0) | 132 if (geteuid() != 0) |
128 return; | 133 return; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 178 |
174 // WMState is owned as a member, so don't have MusClient create it. | 179 // WMState is owned as a member, so don't have MusClient create it. |
175 const bool create_wm_state = false; | 180 const bool create_wm_state = false; |
176 mus_client_ = base::MakeUnique<views::MusClient>( | 181 mus_client_ = base::MakeUnique<views::MusClient>( |
177 connection->GetConnector(), service_manager::Identity(), | 182 connection->GetConnector(), service_manager::Identity(), |
178 content::BrowserThread::GetTaskRunnerForThread( | 183 content::BrowserThread::GetTaskRunnerForThread( |
179 content::BrowserThread::IO), | 184 content::BrowserThread::IO), |
180 create_wm_state); | 185 create_wm_state); |
181 #endif // defined(USE_AURA) | 186 #endif // defined(USE_AURA) |
182 } | 187 } |
OLD | NEW |