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

Side by Side Diff: content/shell/browser/shell_android.cc

Issue 130503003: Revert "Add support for closing Android Shell instances from Java." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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.cc ('k') | no next file » | 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 "content/shell/browser/shell.h" 5 #include "content/shell/browser/shell.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 12 matching lines...) Expand all
23 void Shell::PlatformInitialize(const gfx::Size& default_window_size) { 23 void Shell::PlatformInitialize(const gfx::Size& default_window_size) {
24 CommandLine* command_line = CommandLine::ForCurrentProcess(); 24 CommandLine* command_line = CommandLine::ForCurrentProcess();
25 DCHECK(command_line->HasSwitch(switches::kForceCompositingMode)); 25 DCHECK(command_line->HasSwitch(switches::kForceCompositingMode));
26 DCHECK(command_line->HasSwitch(switches::kEnableThreadedCompositing)); 26 DCHECK(command_line->HasSwitch(switches::kEnableThreadedCompositing));
27 } 27 }
28 28
29 void Shell::PlatformExit() { 29 void Shell::PlatformExit() {
30 } 30 }
31 31
32 void Shell::PlatformCleanUp() { 32 void Shell::PlatformCleanUp() {
33 JNIEnv* env = AttachCurrentThread();
34 if (java_object_.is_null())
35 return;
36 Java_Shell_onNativeDestroyed(env, java_object_.obj());
37 } 33 }
38 34
39 void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) { 35 void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) {
40 } 36 }
41 37
42 void Shell::PlatformSetAddressBarURL(const GURL& url) { 38 void Shell::PlatformSetAddressBarURL(const GURL& url) {
43 JNIEnv* env = AttachCurrentThread(); 39 JNIEnv* env = AttachCurrentThread();
44 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); 40 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec());
45 Java_Shell_onUpdateUrl(env, java_object_.obj(), j_url.obj()); 41 Java_Shell_onUpdateUrl(env, java_object_.obj(), j_url.obj());
46 } 42 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 env, java_object_.obj(), enter_fullscreen); 76 env, java_object_.obj(), enter_fullscreen);
81 } 77 }
82 78
83 bool Shell::PlatformIsFullscreenForTabOrPending( 79 bool Shell::PlatformIsFullscreenForTabOrPending(
84 const WebContents* web_contents) const { 80 const WebContents* web_contents) const {
85 JNIEnv* env = AttachCurrentThread(); 81 JNIEnv* env = AttachCurrentThread();
86 return Java_Shell_isFullscreenForTabOrPending(env, java_object_.obj()); 82 return Java_Shell_isFullscreenForTabOrPending(env, java_object_.obj());
87 } 83 }
88 84
89 void Shell::Close() { 85 void Shell::Close() {
90 RemoveShellView(java_object_.obj()); 86 CloseShellView(java_object_.obj());
87 java_object_.Reset();
91 delete this; 88 delete this;
92 } 89 }
93 90
94 // static 91 // static
95 bool Shell::Register(JNIEnv* env) { 92 bool Shell::Register(JNIEnv* env) {
96 return RegisterNativesImpl(env); 93 return RegisterNativesImpl(env);
97 } 94 }
98 95
99 // static
100 void CloseShell(JNIEnv* env, jclass clazz, jlong shellPtr) {
101 Shell* shell = reinterpret_cast<Shell*>(shellPtr);
102 shell->Close();
103 }
104
105 } // namespace content 96 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/android/shell_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698