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

Unified Diff: content/browser/android/web_contents_observer_android.cc

Issue 10963041: Revert "Revert 158067 - Remove native side of content_view_client" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add additional_input_paths as a variable and input to java.gypi Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/android/web_contents_observer_android.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/web_contents_observer_android.cc
diff --git a/content/browser/android/web_contents_observer_android.cc b/content/browser/android/web_contents_observer_android.cc
index 3fa212d1fe674e848163274c090265b34ecc4590..e57c2a5e76858a63fd661d1b76c281cb1757a947 100644
--- a/content/browser/android/web_contents_observer_android.cc
+++ b/content/browser/android/web_contents_observer_android.cc
@@ -35,11 +35,11 @@ WebContentsObserverAndroid::WebContentsObserverAndroid(
WebContentsObserverAndroid::~WebContentsObserverAndroid() {
}
-jint Init(JNIEnv* env, jobject obj, jint native_web_contents) {
- WebContents* web_contents =
- reinterpret_cast<WebContents*>(native_web_contents);
+jint Init(JNIEnv* env, jobject obj, jint native_content_view_core) {
+ ContentViewCore* content_view_core =
+ reinterpret_cast<ContentViewCore*>(native_content_view_core);
WebContentsObserverAndroid* native_observer = new WebContentsObserverAndroid(
- env, obj, web_contents);
+ env, obj, content_view_core->GetWebContents());
return reinterpret_cast<jint>(native_observer);
}
@@ -105,6 +105,21 @@ void WebContentsObserverAndroid::DidFailLoad(
false, is_main_frame, error_code, error_description, validated_url);
}
+void WebContentsObserverAndroid::DidNavigateMainFrame(
+ const LoadCommittedDetails& details,
+ const FrameNavigateParams& params) {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = weak_java_observer_.get(env);
+ if (obj.is_null())
+ return;
+ ScopedJavaLocalRef<jstring> jstring_url =
+ ConvertUTF8ToJavaString(env, params.url.spec());
+ ScopedJavaLocalRef<jstring> jstring_base_url =
+ ConvertUTF8ToJavaString(env, params.base_url.spec());
+ Java_WebContentsObserverAndroid_didNavigateMainFrame(
+ env, obj.obj(), jstring_url.obj(), jstring_base_url.obj());
+}
+
void WebContentsObserverAndroid::DidFailLoadInternal(
bool is_provisional_load,
bool is_main_frame,
« no previous file with comments | « content/browser/android/web_contents_observer_android.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698