Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2824)

Unified Diff: chrome/browser/browser_process_platform_part_chromeos.cc

Issue 2983443002: Make chrome --mus run the UI Service inside the browser process. (Closed)
Patch Set: Rebase Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_process_platform_part_chromeos.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_process_platform_part_chromeos.cc
diff --git a/chrome/browser/browser_process_platform_part_chromeos.cc b/chrome/browser/browser_process_platform_part_chromeos.cc
index 47e06b6dceb818b2afedada5bc444c716ded689a..2b6d56f4eb4324efdf2086ee9a234acdb25c87f2 100644
--- a/chrome/browser/browser_process_platform_part_chromeos.cc
+++ b/chrome/browser/browser_process_platform_part_chromeos.cc
@@ -44,6 +44,7 @@
#include "services/service_manager/public/cpp/interface_provider.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/ui/public/interfaces/constants.mojom.h"
+#include "services/ui/service.h"
#if defined(USE_OZONE)
#include "content/public/common/service_manager_connection.h"
@@ -129,6 +130,15 @@ class ChromeServiceChromeOS : public service_manager::Service,
DISALLOW_COPY_AND_ASSIGN(ChromeServiceChromeOS);
};
+std::unique_ptr<service_manager::Service> CreateEmbeddedUIService(
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
+ base::WeakPtr<ui::ImageCursorsSet> image_cursors_set_weak_ptr) {
+ ui::Service::InProcessConfig config;
+ config.resource_runner = task_runner;
+ config.image_cursors_set_weak_ptr = image_cursors_set_weak_ptr;
+ return base::MakeUnique<ui::Service>(&config);
+}
+
} // namespace
BrowserProcessPlatformPart::BrowserProcessPlatformPart()
@@ -274,6 +284,17 @@ void BrowserProcessPlatformPart::RegisterInProcessServices(
info.task_runner = base::ThreadTaskRunnerHandle::Get();
services->insert(std::make_pair(ash::mojom::kServiceName, info));
}
+
+ if (chromeos::GetAshConfig() == ash::Config::MUS) {
+ service_manager::EmbeddedServiceInfo info;
+ info.factory = base::Bind(&CreateEmbeddedUIService,
+ base::ThreadTaskRunnerHandle::Get(),
+ image_cursors_set_.GetWeakPtr());
+ info.use_own_thread = true;
+ info.message_loop_type = base::MessageLoop::TYPE_UI;
+ info.thread_priority = base::ThreadPriority::DISPLAY;
+ services->insert(std::make_pair(ui::mojom::kServiceName, info));
+ }
}
chromeos::system::SystemClock* BrowserProcessPlatformPart::GetSystemClock() {
« no previous file with comments | « chrome/browser/browser_process_platform_part_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698