OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.layouts; | 5 package org.chromium.chrome.browser.compositor.layouts; |
6 | 6 |
7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.os.Build; | 9 import android.os.Build; |
10 import android.util.SparseArray; | 10 import android.util.SparseArray; |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 String url = tab.getUrl(); | 243 String url = tab.getUrl(); |
244 boolean isNativePage = url != null && url.startsWith(UrlConstants.CHROME
_NATIVE_URL_PREFIX); | 244 boolean isNativePage = url != null && url.startsWith(UrlConstants.CHROME
_NATIVE_URL_PREFIX); |
245 int themeColor = tab.getThemeColor(); | 245 int themeColor = tab.getThemeColor(); |
246 | 246 |
247 boolean canUseLiveTexture = | 247 boolean canUseLiveTexture = |
248 tab.getContentViewCore() != null && !tab.isShowingSadTab() && !i
sNativePage; | 248 tab.getContentViewCore() != null && !tab.isShowingSadTab() && !i
sNativePage; |
249 | 249 |
250 boolean isNtp = tab.getNativePage() instanceof NewTabPage; | 250 boolean isNtp = tab.getNativePage() instanceof NewTabPage; |
251 boolean needsUpdate = layoutTab.initFromHost(tab.getBackgroundColor(), t
ab.shouldStall(), | 251 boolean needsUpdate = layoutTab.initFromHost(tab.getBackgroundColor(), t
ab.shouldStall(), |
252 canUseLiveTexture, themeColor, | 252 canUseLiveTexture, tab.canUseStaticLayer(), themeColor, |
253 ColorUtils.getTextBoxColorForToolbarBackground( | 253 ColorUtils.getTextBoxColorForToolbarBackground( |
254 mContext.getResources(), isNtp, themeColor), | 254 mContext.getResources(), isNtp, themeColor), |
255 ColorUtils.getTextBoxAlphaForToolbarBackground(tab)); | 255 ColorUtils.getTextBoxAlphaForToolbarBackground(tab)); |
256 if (needsUpdate) requestUpdate(); | 256 if (needsUpdate) requestUpdate(); |
257 | 257 |
258 mHost.requestRender(); | 258 mHost.requestRender(); |
259 } | 259 } |
260 | 260 |
261 @Override | 261 @Override |
262 public LayoutTab createLayoutTab(int id, boolean incognito, boolean showClos
eButton, | 262 public LayoutTab createLayoutTab(int id, boolean incognito, boolean showClos
eButton, |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 || !FeatureUtilities.isDocumentModeEligible(mHost.getContext
()) | 385 || !FeatureUtilities.isDocumentModeEligible(mHost.getContext
()) |
386 || !DeviceClassManager.enableToolbarSwipe() | 386 || !DeviceClassManager.enableToolbarSwipe() |
387 || (manager != null && manager.getPersistentFullscreenMode()
)) { | 387 || (manager != null && manager.getPersistentFullscreenMode()
)) { |
388 return false; | 388 return false; |
389 } | 389 } |
390 | 390 |
391 return direction == ScrollDirection.LEFT || direction == ScrollDirec
tion.RIGHT; | 391 return direction == ScrollDirection.LEFT || direction == ScrollDirec
tion.RIGHT; |
392 } | 392 } |
393 } | 393 } |
394 } | 394 } |
OLD | NEW |