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 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
873 @CalledByNative | 873 @CalledByNative |
874 public String getTitle() { | 874 public String getTitle() { |
875 if (mNativePage != null) return mNativePage.getTitle(); | 875 if (mNativePage != null) return mNativePage.getTitle(); |
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. |
Yaron
2014/07/02 17:43:08
At a minimum this needs to be updated. We should p
Jitu( very slow this week)
2014/07/03 12:21:17
Done.
| |
884 */ | 884 */ |
885 public Bitmap getFavicon() { | 885 public Bitmap getFavicon() { |
886 return null; | 886 if (mNativeTabAndroid == 0) |
887 return null; | |
888 return nativeGetFavicon(mNativeTabAndroid); | |
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; |
896 } | 898 } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1001 * @return The current {@link TabChromeWebContentsDelegateAndroid} instance. | 1003 * @return The current {@link TabChromeWebContentsDelegateAndroid} instance. |
1002 */ | 1004 */ |
1003 protected TabChromeWebContentsDelegateAndroid getChromeWebContentsDelegateAn droid() { | 1005 protected TabChromeWebContentsDelegateAndroid getChromeWebContentsDelegateAn droid() { |
1004 return mWebContentsDelegate; | 1006 return mWebContentsDelegate; |
1005 } | 1007 } |
1006 | 1008 |
1007 /** | 1009 /** |
1008 * Called when the favicon of the content this tab represents changes. | 1010 * Called when the favicon of the content this tab represents changes. |
1009 */ | 1011 */ |
1010 @CalledByNative | 1012 @CalledByNative |
1011 protected void onFaviconUpdated() { | 1013 protected void onFaviconUpdated() { |
Yaron
2014/07/02 17:43:08
Does this get called with your change?
Jitu( very slow this week)
2014/07/03 12:21:17
Yes.
| |
1012 for (TabObserver observer : mObservers) observer.onFaviconUpdated(this); | 1014 for (TabObserver observer : mObservers) observer.onFaviconUpdated(this); |
1013 } | 1015 } |
1014 | 1016 |
1015 /** | 1017 /** |
1016 * Called when the navigation entry containing the historyitem changed, | 1018 * Called when the navigation entry containing the historyitem changed, |
1017 * for example because of a scroll offset or form field change. | 1019 * for example because of a scroll offset or form field change. |
1018 */ | 1020 */ |
1019 @CalledByNative | 1021 @CalledByNative |
1020 protected void onNavEntryChanged() { | 1022 protected void onNavEntryChanged() { |
1021 } | 1023 } |
(...skipping 122 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 |