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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/WebContentsObserver.java

Issue 686213003: Make WebContentsObserver pass more calls to Java. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « content/browser/android/web_contents_observer_android.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 package org.chromium.content.browser; 5 package org.chromium.content.browser;
6 6
7 import org.chromium.base.CalledByNative; 7 import org.chromium.base.CalledByNative;
8 import org.chromium.base.JNINamespace; 8 import org.chromium.base.JNINamespace;
9 import org.chromium.base.ThreadUtils; 9 import org.chromium.base.ThreadUtils;
10 import org.chromium.content_public.browser.WebContents; 10 import org.chromium.content_public.browser.WebContents;
11 11
12 /** 12 /**
13 * This class receives callbacks that act as hooks for various a native web cont ents events related 13 * This class receives callbacks that act as hooks for various a native web cont ents events related
14 * to loading a url. A single web contents can have multiple WebContentObservers . 14 * to loading a url. A single web contents can have multiple WebContentObservers .
15 */ 15 */
16 @JNINamespace("content") 16 @JNINamespace("content")
17 public abstract class WebContentsObserver { 17 public abstract class WebContentsObserver {
18 private long mNativeWebContentsObserverAndroid; 18 private long mNativeWebContentsObserverAndroid;
19 19
20 public WebContentsObserver(WebContents webContents) { 20 public WebContentsObserver(WebContents webContents) {
21 ThreadUtils.assertOnUiThread(); 21 ThreadUtils.assertOnUiThread();
22 mNativeWebContentsObserverAndroid = nativeInit(webContents); 22 mNativeWebContentsObserverAndroid = nativeInit(webContents);
23 } 23 }
24 24
25 /**
26 * Called when the RenderView of the current RenderViewHost is ready, e.g. b ecause we recreated
27 * it after a crash.
28 */
29 @CalledByNative
30 public void renderViewReady() {
31 }
32
25 @CalledByNative 33 @CalledByNative
26 public void renderProcessGone(boolean wasOomProtected) { 34 public void renderProcessGone(boolean wasOomProtected) {
27 } 35 }
28 36
29 /** 37 /**
30 * Called when the a page starts loading. 38 * Called when the a page starts loading.
31 * @param url The validated url for the loading page. 39 * @param url The validated url for the loading page.
32 */ 40 */
33 @CalledByNative 41 @CalledByNative
34 public void didStartLoading(String url) { 42 public void didStartLoading(String url) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 * Similar to didNavigateMainFrame but also called on subframe navigations. 100 * Similar to didNavigateMainFrame but also called on subframe navigations.
93 * @param url The validated url for the page. 101 * @param url The validated url for the page.
94 * @param baseUrl The validated base url for the page. 102 * @param baseUrl The validated base url for the page.
95 * @param isReload True if this navigation is a reload. 103 * @param isReload True if this navigation is a reload.
96 */ 104 */
97 @CalledByNative 105 @CalledByNative
98 public void didNavigateAnyFrame(String url, String baseUrl, boolean isReload ) { 106 public void didNavigateAnyFrame(String url, String baseUrl, boolean isReload ) {
99 } 107 }
100 108
101 /** 109 /**
110 * Called once the window.document object of the main frame was created.
111 */
112 @CalledByNative
113 public void documentAvailableInMainFrame() {
114 }
115
116 /**
102 * Notifies that a load is started for a given frame. 117 * Notifies that a load is started for a given frame.
103 * @param frameId A positive, non-zero integer identifying the navigating fr ame. 118 * @param frameId A positive, non-zero integer identifying the navigating fr ame.
104 * @param parentFrameId The frame identifier of the frame containing the nav igating frame, 119 * @param parentFrameId The frame identifier of the frame containing the nav igating frame,
105 * or -1 if the frame is not contained in another frame . 120 * or -1 if the frame is not contained in another frame .
106 * @param isMainFrame Whether the load is happening for the main frame. 121 * @param isMainFrame Whether the load is happening for the main frame.
107 * @param validatedUrl The validated URL that is being navigated to. 122 * @param validatedUrl The validated URL that is being navigated to.
108 * @param isErrorPage Whether this is navigating to an error page. 123 * @param isErrorPage Whether this is navigating to an error page.
109 * @param isIframeSrcdoc Whether this is navigating to about:srcdoc. 124 * @param isIframeSrcdoc Whether this is navigating to about:srcdoc.
110 */ 125 */
111 @CalledByNative 126 @CalledByNative
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 public void detachFromWebContents() { 202 public void detachFromWebContents() {
188 if (mNativeWebContentsObserverAndroid != 0) { 203 if (mNativeWebContentsObserverAndroid != 0) {
189 nativeDestroy(mNativeWebContentsObserverAndroid); 204 nativeDestroy(mNativeWebContentsObserverAndroid);
190 mNativeWebContentsObserverAndroid = 0; 205 mNativeWebContentsObserverAndroid = 0;
191 } 206 }
192 } 207 }
193 208
194 private native long nativeInit(WebContents webContents); 209 private native long nativeInit(WebContents webContents);
195 private native void nativeDestroy(long nativeWebContentsObserverAndroid); 210 private native void nativeDestroy(long nativeWebContentsObserverAndroid);
196 } 211 }
OLDNEW
« no previous file with comments | « content/browser/android/web_contents_observer_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698