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

Unified Diff: mojo/shell/android/mojo_main.cc

Issue 240003006: Get sample_app running on Android again (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 6 years, 8 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 | « mojo/mojo_services.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/android/mojo_main.cc
diff --git a/mojo/shell/android/mojo_main.cc b/mojo/shell/android/mojo_main.cc
index a9128646e423ea9a43086a415d1c15f69dd81ec6..889d893c751344d66148d682528f0f1424091f2d 100644
--- a/mojo/shell/android/mojo_main.cc
+++ b/mojo/shell/android/mojo_main.cc
@@ -13,10 +13,10 @@
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "jni/MojoMain_jni.h"
+#include "mojo/public/cpp/environment/environment.h"
#include "mojo/public/cpp/shell/application.h"
#include "mojo/service_manager/service_loader.h"
#include "mojo/service_manager/service_manager.h"
-#include "mojo/services/native_viewport/native_viewport_service.h"
#include "mojo/shell/context.h"
#include "mojo/shell/init.h"
#include "mojo/shell/run.h"
@@ -34,28 +34,8 @@ LazyInstance<scoped_ptr<base::MessageLoop> > g_java_message_loop =
LazyInstance<scoped_ptr<shell::Context> > g_context =
LAZY_INSTANCE_INITIALIZER;
-class NativeViewportServiceLoader : public ServiceLoader {
- public:
- NativeViewportServiceLoader() {}
- virtual ~NativeViewportServiceLoader() {}
-
- private:
- virtual void LoadService(ServiceManager* manager,
- const GURL& url,
- ScopedShellHandle service_handle) OVERRIDE {
- app_.reset(CreateNativeViewportService(g_context.Get().get(),
- service_handle.Pass()));
- }
-
- virtual void OnServiceError(ServiceManager* manager,
- const GURL& url) OVERRIDE {
- }
-
- scoped_ptr<Application> app_;
-};
-
-LazyInstance<scoped_ptr<NativeViewportServiceLoader> >
- g_viewport_service_loader = LAZY_INSTANCE_INITIALIZER;
+LazyInstance<scoped_ptr<mojo::Environment> > g_env =
+ LAZY_INSTANCE_INITIALIZER;
} // namspace
@@ -93,15 +73,13 @@ static void Start(JNIEnv* env, jclass clazz, jobject context, jstring jurl) {
CommandLine::ForCurrentProcess()->InitFromArgv(argv);
}
+ g_env.Get().reset(new Environment);
+
base::android::ScopedJavaGlobalRef<jobject> activity;
activity.Reset(env, context);
shell::Context* shell_context = new shell::Context();
shell_context->set_activity(activity.obj());
- g_viewport_service_loader.Get().reset(new NativeViewportServiceLoader());
- shell_context->service_manager()->SetLoaderForURL(
- g_viewport_service_loader.Get().get(),
- GURL("mojo:mojo_native_viewport_service"));
g_context.Get().reset(shell_context);
shell::Run(shell_context);
« no previous file with comments | « mojo/mojo_services.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698