OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.graphics.Color; | 10 import android.graphics.Color; |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
876 if (mContentViewCore != null) return mContentViewCore.getTitle(); | 876 if (mContentViewCore != null) return mContentViewCore.getTitle(); |
877 return ""; | 877 return ""; |
878 } | 878 } |
879 | 879 |
880 /** | 880 /** |
881 * @return The bitmap of the favicon scaled to 16x16dp. null if no favicon | 881 * @return The bitmap of the favicon scaled to 16x16dp. null if no favicon |
882 * is specified or it requires the default favicon. | 882 * is specified or it requires the default favicon. |
883 * TODO(bauerb): Upstream implementation. | 883 * TODO(bauerb): Upstream implementation. |
884 */ | 884 */ |
885 public Bitmap getFavicon() { | 885 public Bitmap getFavicon() { |
886 if (mNativeTabAndroid != 0) | |
Bernhard Bauer
2014/07/02 13:32:28
Nit: I would probably invert this and bail out ear
Jitu( very slow this week)
2014/07/02 13:54:55
Done.
| |
887 return nativeGetFavicon(mNativeTabAndroid); | |
886 return null; | 888 return null; |
887 } | 889 } |
888 | 890 |
889 /** | 891 /** |
890 * Loads the tab if it's not loaded (e.g. because it was killed in backgroun d). | 892 * Loads the tab if it's not loaded (e.g. because it was killed in backgroun d). |
891 * @return true iff tab load was triggered | 893 * @return true iff tab load was triggered |
892 */ | 894 */ |
893 @CalledByNative | 895 @CalledByNative |
894 public boolean loadIfNeeded() { | 896 public boolean loadIfNeeded() { |
895 return false; | 897 return false; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1144 private native void nativeDestroyWebContents(long nativeTabAndroid, boolean deleteNative); | 1146 private native void nativeDestroyWebContents(long nativeTabAndroid, boolean deleteNative); |
1145 private native WebContents nativeGetWebContents(long nativeTabAndroid); | 1147 private native WebContents nativeGetWebContents(long nativeTabAndroid); |
1146 private native Profile nativeGetProfileAndroid(long nativeTabAndroid); | 1148 private native Profile nativeGetProfileAndroid(long nativeTabAndroid); |
1147 private native int nativeLoadUrl(long nativeTabAndroid, String url, String e xtraHeaders, | 1149 private native int nativeLoadUrl(long nativeTabAndroid, String url, String e xtraHeaders, |
1148 byte[] postData, int transition, String referrerUrl, int referrerPol icy, | 1150 byte[] postData, int transition, String referrerUrl, int referrerPol icy, |
1149 boolean isRendererInitiated); | 1151 boolean isRendererInitiated); |
1150 private native int nativeGetSecurityLevel(long nativeTabAndroid); | 1152 private native int nativeGetSecurityLevel(long nativeTabAndroid); |
1151 private native void nativeSetActiveNavigationEntryTitleForUrl(long nativeTab Android, String url, | 1153 private native void nativeSetActiveNavigationEntryTitleForUrl(long nativeTab Android, String url, |
1152 String title); | 1154 String title); |
1153 private native boolean nativePrint(long nativeTabAndroid); | 1155 private native boolean nativePrint(long nativeTabAndroid); |
1156 private native Bitmap nativeGetFavicon(long nativeTabAndroid); | |
1154 } | 1157 } |
OLD | NEW |