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

Side by Side Diff: content/shell/android/shell_manager.cc

Issue 10800019: Refactor ContentShell to remove ContentViewClient dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « content/shell/android/shell_manager.h ('k') | content/shell/android/shell_view.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/shell/android/shell_manager.h" 5 #include "content/shell/android/shell_manager.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/scoped_java_ref.h" 8 #include "base/android/scoped_java_ref.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "content/shell/android/shell_view.h"
11 #include "jni/shell_manager_jni.h" 10 #include "jni/shell_manager_jni.h"
12 11
13 using base::android::ScopedJavaLocalRef; 12 using base::android::ScopedJavaLocalRef;
14 13
15 base::LazyInstance<base::android::ScopedJavaGlobalRef<jobject> > 14 base::LazyInstance<base::android::ScopedJavaGlobalRef<jobject> >
16 g_content_shell_manager = LAZY_INSTANCE_INITIALIZER; 15 g_content_shell_manager = LAZY_INSTANCE_INITIALIZER;
17 16
18 namespace content { 17 namespace content {
19 18
20 ShellView* CreateShellView() { 19 jobject CreateShellView() {
21 JNIEnv* env = base::android::AttachCurrentThread(); 20 JNIEnv* env = base::android::AttachCurrentThread();
22 return reinterpret_cast<ShellView*>(Java_ShellManager_createShell( 21 return Java_ShellManager_createShell(
23 env, g_content_shell_manager.Get().obj())); 22 env, g_content_shell_manager.Get().obj()).Release();
24 } 23 }
25 24
26 // Register native methods 25 // Register native methods
27 bool RegisterShellManager(JNIEnv* env) { 26 bool RegisterShellManager(JNIEnv* env) {
28 return RegisterNativesImpl(env); 27 return RegisterNativesImpl(env);
29 } 28 }
30 29
31 static void Init(JNIEnv* env, jclass clazz, jobject obj) { 30 static void Init(JNIEnv* env, jclass clazz, jobject obj) {
32 g_content_shell_manager.Get().Reset( 31 g_content_shell_manager.Get().Reset(
33 base::android::ScopedJavaLocalRef<jobject>(env, obj)); 32 base::android::ScopedJavaLocalRef<jobject>(env, obj));
34 } 33 }
35 34
36 } // namespace content 35 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/android/shell_manager.h ('k') | content/shell/android/shell_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698