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

Unified Diff: content/shell/browser/shell_content_browser_client.cc

Issue 2431753002: Mus experiment in content shell on Android.
Patch Set: Fix mac bot Created 4 years, 1 month 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 | « content/shell/browser/shell_android.cc ('k') | content/shell/common/shell_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/shell_content_browser_client.cc
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc
index 6fa4cb14cf772bfc0fb2008d819ba0d78ce706d0..a6e86f0a0a2eae02972be3c77a7aa022ad98ef3b 100644
--- a/content/shell/browser/shell_content_browser_client.cc
+++ b/content/shell/browser/shell_content_browser_client.cc
@@ -48,6 +48,9 @@
#include "base/android/path_utils.h"
#include "components/crash/content/browser/crash_dump_manager_android.h"
#include "content/shell/android/shell_descriptors.h"
+#include "services/ui/demo/mus_demo.h" // nogncheck
+#include "services/ui/ime/test_ime_driver/test_ime_application.h" // nogncheck
+#include "services/ui/service.h" // nogncheck
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
@@ -121,6 +124,28 @@ int GetCrashSignalFD(const base::CommandLine& command_line) {
}
#endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
+#if defined(OS_ANDROID)
+
+// Factory methods to create embedded services.
+
+std::unique_ptr<service_manager::Service> CreateMojoUIApplication(
+ const base::Closure& quit_closure) {
+ return std::unique_ptr<service_manager::Service>(new ui::Service());
+}
+
+std::unique_ptr<service_manager::Service> CreateMojoTestIMEApplication(
+ const base::Closure& quit_closure) {
+ return std::unique_ptr<service_manager::Service>(
+ new ui::test::TestIMEApplication());
+}
+
+std::unique_ptr<service_manager::Service> CreateMojoMusDemoService(
+ const base::Closure& quit_closure) {
+ return std::unique_ptr<ui::demo::MusDemo>(new ui::demo::MusDemo());
+}
+
+#endif // defined(OS_ANDROID)
+
} // namespace
ShellContentBrowserClient* ShellContentBrowserClient::Get() {
@@ -194,6 +219,23 @@ void ShellContentBrowserClient::RegisterInProcessServices(
info.factory = base::Bind(&media::CreateMediaServiceForTesting);
services->insert(std::make_pair("service:media", info));
#endif
+#if defined(OS_ANDROID)
+ // Register Mus and the required services for the Mus demo to run.
+ content::ServiceInfo mus_info;
+ mus_info.factory = base::Bind(&CreateMojoUIApplication);
+ mus_info.service_owns_context = true;
+ services->insert(std::make_pair("service:ui", mus_info));
+
+ content::ServiceInfo mus_demo_info;
+ mus_demo_info.factory = base::Bind(&CreateMojoMusDemoService);
+ mus_demo_info.service_owns_context = true;
+ services->insert(std::make_pair("service:mus_demo", mus_demo_info));
+
+ content::ServiceInfo test_ime_info;
+ test_ime_info.factory = base::Bind(&CreateMojoTestIMEApplication);
+ test_ime_info.service_owns_context = true;
+ services->insert(std::make_pair("service:test_ime_driver", test_ime_info));
+#endif
}
void ShellContentBrowserClient::RegisterOutOfProcessServices(
« no previous file with comments | « content/shell/browser/shell_android.cc ('k') | content/shell/common/shell_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698