Chromium Code Reviews| Index: chrome/browser/chrome_content_browser_client.cc |
| diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc |
| index 1c680d221196c1a0001dfb77db43b509b17be272..b9be582d66b30ca840418b05e8086c7bc9b605ab 100644 |
| --- a/chrome/browser/chrome_content_browser_client.cc |
| +++ b/chrome/browser/chrome_content_browser_client.cc |
| @@ -258,6 +258,9 @@ |
| #include "components/user_manager/user_manager.h" |
| #include "mash/public/interfaces/launchable.mojom.h" |
| #include "services/service_manager/public/interfaces/interface_provider_spec.mojom.h" |
| +#include "services/ui/public/interfaces/constants.mojom.h" |
| +#include "services/ui/service.h" |
| +#include "ui/base/cursor/image_cursors.h" |
| #elif defined(OS_LINUX) |
| #include "chrome/browser/chrome_browser_main_linux.h" |
| #elif defined(OS_ANDROID) |
| @@ -858,6 +861,14 @@ WebContents* GetWebContents(int render_process_id, int render_frame_id) { |
| return WebContents::FromRenderFrameHost(rfh); |
| } |
| +#if defined(OS_CHROMEOS) |
| +std::unique_ptr<service_manager::Service> CreateEmbeddedUIService( |
| + const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| + base::WeakPtr<ui::ImageCursors> image_cursors_weak_ptr) { |
| + return base::MakeUnique<ui::Service>(task_runner, image_cursors_weak_ptr); |
| +} |
| +#endif // defined(OS_CHROMEOS) |
| + |
| #if BUILDFLAG(ENABLE_EXTENSIONS) |
| // Returns true if there is is an extension with the same origin as |
| // |source_origin| in |opener_render_process_id| with |
| @@ -3030,11 +3041,22 @@ void ChromeContentBrowserClient::RegisterInProcessServices( |
| } |
| if (!ash_util::IsRunningInMash()) { |
| - content::ServiceInfo info; |
| - info.factory = base::Bind(&ash_util::CreateEmbeddedAshService, |
| - base::ThreadTaskRunnerHandle::Get()); |
| - info.task_runner = base::ThreadTaskRunnerHandle::Get(); |
| - services->insert(std::make_pair(ash::mojom::kServiceName, info)); |
| + content::ServiceInfo info_ash; |
| + info_ash.factory = base::Bind(&ash_util::CreateEmbeddedAshService, |
| + base::ThreadTaskRunnerHandle::Get()); |
| + info_ash.task_runner = base::ThreadTaskRunnerHandle::Get(); |
| + services->insert(std::make_pair(ash::mojom::kServiceName, info_ash)); |
| + |
| + if (!image_cursors_) |
|
sky
2017/06/27 19:58:56
Is this conditional necessary?
We're starting to
mfomitchev
2017/07/11 21:46:59
Done. Moved a bunch of code into browser_process_p
|
| + image_cursors_ = base::MakeUnique<ui::ImageCursors>(); |
| + content::ServiceInfo info_ui; |
| + info_ui.factory = base::Bind(&CreateEmbeddedUIService, |
| + base::ThreadTaskRunnerHandle::Get(), |
| + image_cursors_->GetWeakPtr()); |
| + info_ui.use_own_thread = true; |
| + info_ui.message_loop_type = base::MessageLoop::TYPE_UI; |
| + info_ui.thread_priority = base::ThreadPriority::DISPLAY; |
| + services->insert(std::make_pair(ui::mojom::kServiceName, info_ui)); |
| } |
| #endif // OS_CHROMEOS |
| } |