OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 package org.chromium.chrome.browser.profiles; | 5 package org.chromium.chrome.browser.profiles; |
6 | 6 |
7 import org.chromium.base.CalledByNative; | 7 import org.chromium.base.CalledByNative; |
8 | 8 |
9 /** | 9 /** |
10 * Wrapper that allows passing a Profile reference around in the Java layer. | 10 * Wrapper that allows passing a Profile reference around in the Java layer. |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 @CalledByNative | 25 @CalledByNative |
26 private void destroy() { | 26 private void destroy() { |
27 mNativeProfileAndroid = 0; | 27 mNativeProfileAndroid = 0; |
28 } | 28 } |
29 | 29 |
30 @CalledByNative | 30 @CalledByNative |
31 private int getNativePointer() { | 31 private int getNativePointer() { |
32 return mNativeProfileAndroid; | 32 return mNativeProfileAndroid; |
33 } | 33 } |
| 34 |
| 35 /** |
| 36 * Check whether a given url has finished prerendering using the prerender |
| 37 * manager associated with this profile |
| 38 * @param url The url to check. |
| 39 * @return Whether the given url has finished prerendering. |
| 40 */ |
| 41 public boolean hasPrerenderedUrl(String url) { |
| 42 return nativeHasPrerenderedUrl(mNativeProfileAndroid, url); |
| 43 } |
| 44 |
| 45 /** |
| 46 * @return The java profile with the default native profile. |
| 47 */ |
| 48 public static Profile getDefaultProfile() { |
| 49 return new Profile(nativeGetDefaultProfile()); |
| 50 } |
| 51 |
| 52 private static native int nativeGetDefaultProfile(); |
| 53 private static native boolean nativeHasPrerenderedUrl(int nativeProfileAndro
id, String url); |
34 } | 54 } |
OLD | NEW |