Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java

Issue 2847523002: Android: Remove GetApplicationContext part 4 (Closed)
Patch Set: Rebase and fix build Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698