OLD | NEW |
---|---|
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; |
nyquist
2014/09/25 16:57:28
remove this and JNINamespace after you remove all
wajahat
2014/09/29 14:43:25
Done.
| |
8 import org.chromium.base.JNINamespace; | 8 import org.chromium.base.JNINamespace; |
9 import org.chromium.base.ThreadUtils; | 9 import org.chromium.content.browser.WebContentsObserver; |
nyquist
2014/09/25 16:57:28
They are in the same package, so this in unnecessa
wajahat
2014/09/29 14:43:24
Done.
| |
10 import org.chromium.content_public.browser.WebContents; | 10 import org.chromium.content_public.browser.WebContents; |
11 | 11 |
12 /** | 12 /** |
13 * @deprecated This class is renamed to WebContentsObserver | |
nyquist
2014/09/25 16:57:28
Could you use {@link WebContentsObserver}?
Also, j
wajahat
2014/09/29 14:43:25
Done.
| |
14 * in future this will be removed. | |
15 */ | |
16 @Deprecated | |
17 /** | |
13 * This class receives callbacks that act as hooks for various a native web cont ents events related | 18 * 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 WebContentObserverA ndroids. | 19 * to loading a url. A single web contents can have multiple WebContentObserverA ndroids. |
15 */ | 20 */ |
16 @JNINamespace("content") | 21 @JNINamespace("content") |
nyquist
2014/09/25 16:57:28
This annotation should not be needed anymore.
wajahat
2014/09/29 14:43:25
Done.
| |
17 public abstract class WebContentsObserverAndroid { | 22 public abstract class WebContentsObserverAndroid extends WebContentsObserver { |
18 private long mNativeWebContentsObserverAndroid; | |
19 | 23 |
20 public WebContentsObserverAndroid(WebContents webContents) { | 24 public WebContentsObserverAndroid(WebContents webContents) { |
21 ThreadUtils.assertOnUiThread(); | 25 super(webContents); |
22 mNativeWebContentsObserverAndroid = nativeInit(webContents); | |
23 } | 26 } |
24 | 27 |
25 @CalledByNative | 28 @CalledByNative |
nyquist
2014/09/25 16:57:28
I don't think these annotations are needed anymore
wajahat
2014/09/29 14:43:25
Done.
| |
26 public void renderProcessGone(boolean wasOomProtected) { | 29 public void renderProcessGone(boolean wasOomProtected) { |
nyquist
2014/09/25 16:57:28
In fact, you can just remove all the methods in th
Yaron
2014/09/25 22:46:16
Right. If you didn't remove them this would actual
wajahat
2014/09/29 14:43:24
Done.
wajahat
2014/09/29 14:43:25
Done.
wajahat
2014/09/29 14:43:25
Done.
| |
27 } | 30 } |
28 | 31 |
29 /** | 32 /** |
30 * Called when the a page starts loading. | 33 * Called when the a page starts loading. |
31 * @param url The validated url for the loading page. | 34 * @param url The validated url for the loading page. |
32 */ | 35 */ |
33 @CalledByNative | 36 @CalledByNative |
34 public void didStartLoading(String url) { | 37 public void didStartLoading(String url) { |
35 } | 38 } |
36 | 39 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 */ | 166 */ |
164 @CalledByNative | 167 @CalledByNative |
165 public void didChangeThemeColor(int color) { | 168 public void didChangeThemeColor(int color) { |
166 } | 169 } |
167 | 170 |
168 /** | 171 /** |
169 * Destroy the corresponding native object. | 172 * Destroy the corresponding native object. |
170 */ | 173 */ |
171 @CalledByNative | 174 @CalledByNative |
172 public void detachFromWebContents() { | 175 public void detachFromWebContents() { |
173 if (mNativeWebContentsObserverAndroid != 0) { | |
174 nativeDestroy(mNativeWebContentsObserverAndroid); | |
175 mNativeWebContentsObserverAndroid = 0; | |
176 } | |
177 } | 176 } |
178 | |
179 private native long nativeInit(WebContents webContents); | |
180 private native void nativeDestroy(long nativeWebContentsObserverAndroid); | |
181 } | 177 } |
OLD | NEW |