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.compositor; | 5 package org.chromium.chrome.browser.compositor; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.res.Resources; | 8 import android.content.res.Resources; |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.text.TextUtils; | 10 import android.text.TextUtils; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 return titleString; | 118 return titleString; |
119 } | 119 } |
120 | 120 |
121 private String getUpdatedTitleInternal(Tab tab, String titleString, | 121 private String getUpdatedTitleInternal(Tab tab, String titleString, |
122 boolean fetchFaviconFromHistory) { | 122 boolean fetchFaviconFromHistory) { |
123 final int tabId = tab.getId(); | 123 final int tabId = tab.getId(); |
124 Bitmap originalFavicon = tab.getFavicon(); | 124 Bitmap originalFavicon = tab.getFavicon(); |
125 | 125 |
126 boolean isDarkTheme = tab.isIncognito(); | 126 boolean isDarkTheme = tab.isIncognito(); |
127 // The theme might require lighter text. | 127 // The theme might require lighter text. |
128 if (!DeviceFormFactor.isTablet(mContext)) { | 128 if (!DeviceFormFactor.isTablet()) { |
129 isDarkTheme |= ColorUtils.shouldUseLightForegroundOnBackground(tab.g
etThemeColor()); | 129 isDarkTheme |= ColorUtils.shouldUseLightForegroundOnBackground(tab.g
etThemeColor()); |
130 } | 130 } |
131 | 131 |
132 ColorUtils.shouldUseLightForegroundOnBackground(tab.getThemeColor()); | 132 ColorUtils.shouldUseLightForegroundOnBackground(tab.getThemeColor()); |
133 boolean isRtl = tab.isTitleDirectionRtl(); | 133 boolean isRtl = tab.isTitleDirectionRtl(); |
134 TitleBitmapFactory titleBitmapFactory = isDarkTheme | 134 TitleBitmapFactory titleBitmapFactory = isDarkTheme |
135 ? mDarkTitleBitmapFactory : mStandardTitleBitmapFactory; | 135 ? mDarkTitleBitmapFactory : mStandardTitleBitmapFactory; |
136 | 136 |
137 Title title = mTitles.get(tabId); | 137 Title title = mTitles.get(tabId); |
138 if (title == null) { | 138 if (title == null) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 private native long nativeInit(int fadeWidth, int faviconStartlPadding, int
faviconEndPadding, | 279 private native long nativeInit(int fadeWidth, int faviconStartlPadding, int
faviconEndPadding, |
280 int spinnerResId, int spinnerIncognitoResId); | 280 int spinnerResId, int spinnerIncognitoResId); |
281 private static native void nativeDestroy(long nativeLayerTitleCache); | 281 private static native void nativeDestroy(long nativeLayerTitleCache); |
282 private native void nativeClearExcept(long nativeLayerTitleCache, int except
Id); | 282 private native void nativeClearExcept(long nativeLayerTitleCache, int except
Id); |
283 private native void nativeUpdateLayer(long nativeLayerTitleCache, int tabId,
int titleResId, | 283 private native void nativeUpdateLayer(long nativeLayerTitleCache, int tabId,
int titleResId, |
284 int faviconResId, boolean isIncognito, boolean isRtl); | 284 int faviconResId, boolean isIncognito, boolean isRtl); |
285 private native void nativeUpdateFavicon(long nativeLayerTitleCache, int tabI
d, | 285 private native void nativeUpdateFavicon(long nativeLayerTitleCache, int tabI
d, |
286 int faviconResId); | 286 int faviconResId); |
287 } | 287 } |
OLD | NEW |