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

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

Issue 14977010: Android: implement content::Shell::Close() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/shell_android.cc » ('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/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 20 matching lines...) Expand all
31 } // namespace 31 } // namespace
32 32
33 namespace content { 33 namespace content {
34 34
35 jobject CreateShellView(Shell* shell) { 35 jobject CreateShellView(Shell* shell) {
36 JNIEnv* env = base::android::AttachCurrentThread(); 36 JNIEnv* env = base::android::AttachCurrentThread();
37 jobject j_shell_manager = g_global_state.Get().j_shell_manager.obj(); 37 jobject j_shell_manager = g_global_state.Get().j_shell_manager.obj();
38 return Java_ShellManager_createShell(env, j_shell_manager).Release(); 38 return Java_ShellManager_createShell(env, j_shell_manager).Release();
39 } 39 }
40 40
41 void CloseShellView(jobject shell_view) {
42 JNIEnv* env = base::android::AttachCurrentThread();
43 jobject j_shell_manager = g_global_state.Get().j_shell_manager.obj();
44 Java_ShellManager_closeShell(env, j_shell_manager, shell_view);
45 }
46
41 // Register native methods 47 // Register native methods
42 bool RegisterShellManager(JNIEnv* env) { 48 bool RegisterShellManager(JNIEnv* env) {
43 return RegisterNativesImpl(env); 49 return RegisterNativesImpl(env);
44 } 50 }
45 51
46 static void Init(JNIEnv* env, jclass clazz, jobject obj) { 52 static void Init(JNIEnv* env, jclass clazz, jobject obj) {
47 g_global_state.Get().j_shell_manager.Reset( 53 g_global_state.Get().j_shell_manager.Reset(
48 base::android::ScopedJavaLocalRef<jobject>(env, obj)); 54 base::android::ScopedJavaLocalRef<jobject>(env, obj));
49 } 55 }
50 56
51 void LaunchShell(JNIEnv* env, jclass clazz, jstring jurl) { 57 void LaunchShell(JNIEnv* env, jclass clazz, jstring jurl) {
52 ShellBrowserContext* browserContext = 58 ShellBrowserContext* browserContext =
53 ShellContentBrowserClient::Get()->browser_context(); 59 ShellContentBrowserClient::Get()->browser_context();
54 GURL url(base::android::ConvertJavaStringToUTF8(env, jurl)); 60 GURL url(base::android::ConvertJavaStringToUTF8(env, jurl));
55 Shell::CreateNewWindow(browserContext, 61 Shell::CreateNewWindow(browserContext,
56 url, 62 url,
57 NULL, 63 NULL,
58 MSG_ROUTING_NONE, 64 MSG_ROUTING_NONE,
59 gfx::Size()); 65 gfx::Size());
60 } 66 }
61 67
62 } // namespace content 68 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/android/shell_manager.h ('k') | content/shell/shell_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698