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

Side by Side Diff: mojo/shell/android/mojo_main.cc

Issue 404913002: Break dependency of native_viewport_service on mojo::shell::Context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move call to GetApplicationContext() to native_viewport_android Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/services/native_viewport/native_viewport_x11.cc ('k') | mojo/shell/context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/shell/android/mojo_main.h" 5 #include "mojo/shell/android/mojo_main.h"
6 6
7 #include "base/android/java_handler_thread.h" 7 #include "base/android/java_handler_thread.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 20 matching lines...) Expand all
31 LAZY_INSTANCE_INITIALIZER; 31 LAZY_INSTANCE_INITIALIZER;
32 32
33 LazyInstance<scoped_ptr<shell::Context> > g_context = 33 LazyInstance<scoped_ptr<shell::Context> > g_context =
34 LAZY_INSTANCE_INITIALIZER; 34 LAZY_INSTANCE_INITIALIZER;
35 35
36 LazyInstance<scoped_ptr<base::android::JavaHandlerThread> > g_shell_thread = 36 LazyInstance<scoped_ptr<base::android::JavaHandlerThread> > g_shell_thread =
37 LAZY_INSTANCE_INITIALIZER; 37 LAZY_INSTANCE_INITIALIZER;
38 38
39 void RunShell(std::vector<GURL> app_urls) { 39 void RunShell(std::vector<GURL> app_urls) {
40 shell::Context* shell_context = new shell::Context(); 40 shell::Context* shell_context = new shell::Context();
41 shell_context->set_activity(base::android::GetApplicationContext());
42 shell_context->set_ui_loop(g_java_message_loop.Get().get()); 41 shell_context->set_ui_loop(g_java_message_loop.Get().get());
43 42
44 g_context.Get().reset(shell_context); 43 g_context.Get().reset(shell_context);
45 shell::Run(shell_context, app_urls); 44 shell::Run(shell_context, app_urls);
46 } 45 }
47 46
48 } // namespace 47 } // namespace
49 48
50 static void Init(JNIEnv* env, jclass clazz, jobject context) { 49 static void Init(JNIEnv* env, jclass clazz, jobject context) {
51 base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context); 50 base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context);
(...skipping 28 matching lines...) Expand all
80 g_shell_thread.Get()->Start(); 79 g_shell_thread.Get()->Start();
81 g_shell_thread.Get()->message_loop()->PostTask( 80 g_shell_thread.Get()->message_loop()->PostTask(
82 FROM_HERE, base::Bind(&RunShell, app_urls)); 81 FROM_HERE, base::Bind(&RunShell, app_urls));
83 } 82 }
84 83
85 bool RegisterMojoMain(JNIEnv* env) { 84 bool RegisterMojoMain(JNIEnv* env) {
86 return RegisterNativesImpl(env); 85 return RegisterNativesImpl(env);
87 } 86 }
88 87
89 } // namespace mojo 88 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/native_viewport/native_viewport_x11.cc ('k') | mojo/shell/context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698