summaryrefslogtreecommitdiffstats
path: root/mojo/shell
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-21 21:12:08 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-21 21:12:08 +0000
commit8c17298b91bc30c753d333af3496429ca292aeae (patch)
treeffdaec13da8aaed09d0f4dec668f00134fe9e551 /mojo/shell
parent25866264106adba0372acb476691f2ea5ac694c9 (diff)
downloadchromium_src-8c17298b91bc30c753d333af3496429ca292aeae.zip
chromium_src-8c17298b91bc30c753d333af3496429ca292aeae.tar.gz
chromium_src-8c17298b91bc30c753d333af3496429ca292aeae.tar.bz2
Get sample_app running on Android again
Second try after first broke build https://codereview.chromium.org/240003006/ TBR=viettrungluu BUG= Review URL: https://codereview.chromium.org/242973004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265070 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/shell')
-rw-r--r--mojo/shell/android/mojo_main.cc27
1 files changed, 5 insertions, 22 deletions
diff --git a/mojo/shell/android/mojo_main.cc b/mojo/shell/android/mojo_main.cc
index 88ce11e..9d70c8f 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,25 +34,9 @@ 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<mojo::Environment> > g_env =
+ LAZY_INSTANCE_INITIALIZER;
} // namspace
@@ -90,14 +74,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());
- shell_context->service_manager()->SetLoaderForURL(
- make_scoped_ptr<ServiceLoader>(new NativeViewportServiceLoader),
- GURL("mojo:mojo_native_viewport_service"));
g_context.Get().reset(shell_context);
shell::Run(shell_context);