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

Side by Side Diff: content/browser/android/web_contents_observer_proxy.cc

Issue 1008913002: Remove RenderViewHost parameter from WebContentsObserver::Did{Start|Stop}Loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 9 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/android/web_contents_observer_proxy.h" 5 #include "content/browser/android/web_contents_observer_proxy.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 JNIEnv* env = AttachCurrentThread(); 72 JNIEnv* env = AttachCurrentThread();
73 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); 73 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env));
74 if (obj.is_null()) 74 if (obj.is_null())
75 return; 75 return;
76 jboolean was_oom_protected = 76 jboolean was_oom_protected =
77 termination_status == base::TERMINATION_STATUS_OOM_PROTECTED; 77 termination_status == base::TERMINATION_STATUS_OOM_PROTECTED;
78 Java_WebContentsObserverProxy_renderProcessGone(env, obj.obj(), 78 Java_WebContentsObserverProxy_renderProcessGone(env, obj.obj(),
79 was_oom_protected); 79 was_oom_protected);
80 } 80 }
81 81
82 void WebContentsObserverProxy::DidStartLoading( 82 void WebContentsObserverProxy::DidStartLoading() {
83 RenderViewHost* render_view_host) {
84 JNIEnv* env = AttachCurrentThread(); 83 JNIEnv* env = AttachCurrentThread();
85 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); 84 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env));
86 if (obj.is_null()) 85 if (obj.is_null())
87 return; 86 return;
88 ScopedJavaLocalRef<jstring> jstring_url( 87 ScopedJavaLocalRef<jstring> jstring_url(
89 ConvertUTF8ToJavaString(env, web_contents()->GetVisibleURL().spec())); 88 ConvertUTF8ToJavaString(env, web_contents()->GetVisibleURL().spec()));
90 Java_WebContentsObserverProxy_didStartLoading(env, obj.obj(), 89 Java_WebContentsObserverProxy_didStartLoading(env, obj.obj(),
91 jstring_url.obj()); 90 jstring_url.obj());
92 } 91 }
93 92
94 void WebContentsObserverProxy::DidStopLoading( 93 void WebContentsObserverProxy::DidStopLoading() {
95 RenderViewHost* render_view_host) {
96 JNIEnv* env = AttachCurrentThread(); 94 JNIEnv* env = AttachCurrentThread();
97 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); 95 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env));
98 if (obj.is_null()) 96 if (obj.is_null())
99 return; 97 return;
100 ScopedJavaLocalRef<jstring> jstring_url(ConvertUTF8ToJavaString( 98 ScopedJavaLocalRef<jstring> jstring_url(ConvertUTF8ToJavaString(
101 env, web_contents()->GetLastCommittedURL().spec())); 99 env, web_contents()->GetLastCommittedURL().spec()));
102 Java_WebContentsObserverProxy_didStopLoading(env, obj.obj(), 100 Java_WebContentsObserverProxy_didStopLoading(env, obj.obj(),
103 jstring_url.obj()); 101 jstring_url.obj());
104 } 102 }
105 103
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 ConvertUTF8ToJavaString(env, url.spec())); 319 ConvertUTF8ToJavaString(env, url.spec()));
322 320
323 Java_WebContentsObserverProxy_didStartNavigationToPendingEntry( 321 Java_WebContentsObserverProxy_didStartNavigationToPendingEntry(
324 env, obj.obj(), jstring_url.obj()); 322 env, obj.obj(), jstring_url.obj());
325 } 323 }
326 324
327 bool RegisterWebContentsObserverProxy(JNIEnv* env) { 325 bool RegisterWebContentsObserverProxy(JNIEnv* env) {
328 return RegisterNativesImpl(env); 326 return RegisterNativesImpl(env);
329 } 327 }
330 } // namespace content 328 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/web_contents_observer_proxy.h ('k') | content/browser/frame_host/interstitial_page_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698