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

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

Issue 2163393003: Tab switcher theme colors no longer behind flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Littering flags Created 4 years, 3 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 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.scene_layer; 5 package org.chromium.chrome.browser.compositor.scene_layer;
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.Rect; 9 import android.graphics.Rect;
10 10
11 import org.chromium.base.ApiCompatibilityUtils; 11 import org.chromium.base.ApiCompatibilityUtils;
12 import org.chromium.base.annotations.JNINamespace; 12 import org.chromium.base.annotations.JNINamespace;
13 import org.chromium.chrome.R; 13 import org.chromium.chrome.R;
14 import org.chromium.chrome.browser.compositor.LayerTitleCache; 14 import org.chromium.chrome.browser.compositor.LayerTitleCache;
15 import org.chromium.chrome.browser.compositor.layouts.Layout; 15 import org.chromium.chrome.browser.compositor.layouts.Layout;
16 import org.chromium.chrome.browser.compositor.layouts.Layout.Orientation; 16 import org.chromium.chrome.browser.compositor.layouts.Layout.Orientation;
17 import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab; 17 import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab;
18 import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; 18 import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager;
19 import org.chromium.chrome.browser.util.ColorUtils; 19 import org.chromium.chrome.browser.util.ColorUtils;
20 import org.chromium.chrome.browser.util.FeatureUtilities;
21 import org.chromium.ui.resources.ResourceManager; 20 import org.chromium.ui.resources.ResourceManager;
22 21
23 /** 22 /**
24 * A SceneLayer to render a tab stack. 23 * A SceneLayer to render a tab stack.
25 * TODO(changwan): change layouts to share one instance of this. 24 * TODO(changwan): change layouts to share one instance of this.
26 */ 25 */
27 @JNINamespace("chrome::android") 26 @JNINamespace("chrome::android")
28 public class TabListSceneLayer extends SceneLayer { 27 public class TabListSceneLayer extends SceneLayer {
29 private long mNativePtr; 28 private long mNativePtr;
30 29
(...skipping 24 matching lines...) Expand all
55 54
56 for (int i = 0; i < tabsCount; i++) { 55 for (int i = 0; i < tabsCount; i++) {
57 LayoutTab t = tabs[i]; 56 LayoutTab t = tabs[i];
58 assert t.isVisible() : "LayoutTab in that list should be visible"; 57 assert t.isVisible() : "LayoutTab in that list should be visible";
59 final float decoration = t.getDecorationAlpha(); 58 final float decoration = t.getDecorationAlpha();
60 59
61 int defaultThemeColor = t.isIncognito() 60 int defaultThemeColor = t.isIncognito()
62 ? ApiCompatibilityUtils.getColor(res, R.color.incognito_prim ary_color) 61 ? ApiCompatibilityUtils.getColor(res, R.color.incognito_prim ary_color)
63 : ApiCompatibilityUtils.getColor(res, R.color.default_primar y_color); 62 : ApiCompatibilityUtils.getColor(res, R.color.default_primar y_color);
64 63
65 int closeButtonColor = ColorUtils.getThemedAssetColor(defaultThemeCo lor, 64 int closeButtonColor = ColorUtils.getThemedAssetColor(t.getToolbarBa ckgroundColor(),
66 t.isIncognito());
67
68 // If theme colors are enabled in the tab switcher, use them to colo r the assets.
69 if (FeatureUtilities.areTabSwitcherThemeColorsEnabled()) {
70 closeButtonColor = ColorUtils.getThemedAssetColor(t.getToolbarBa ckgroundColor(),
71 t.isIncognito()); 65 t.isIncognito());
72 }
73 66
74 int borderColorResource = 67 int borderColorResource =
75 t.isIncognito() ? R.color.tab_back_incognito : R.color.tab_b ack; 68 t.isIncognito() ? R.color.tab_back_incognito : R.color.tab_b ack;
76 // TODO(dtrainor, clholgat): remove "* dpToPx" once the native part fully supports dp. 69 // TODO(dtrainor, clholgat): remove "* dpToPx" once the native part fully supports dp.
77 nativePutTabLayer(mNativePtr, t.getId(), R.id.control_container, 70 nativePutTabLayer(mNativePtr, t.getId(), R.id.control_container,
78 R.drawable.btn_tab_close, 71 R.drawable.btn_tab_close,
79 R.drawable.tabswitcher_border_frame_shadow, 72 R.drawable.tabswitcher_border_frame_shadow,
80 R.drawable.tabswitcher_border_frame_decoration, R.drawable.l ogo_card_back, 73 R.drawable.tabswitcher_border_frame_decoration, R.drawable.l ogo_card_back,
81 R.drawable.tabswitcher_border_frame, 74 R.drawable.tabswitcher_border_frame,
82 R.drawable.tabswitcher_border_frame_inner_shadow, 75 R.drawable.tabswitcher_border_frame_inner_shadow,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 float shadowX, float shadowY, float shadowWidth, float shadowHeight, float pivotX, 137 float shadowX, float shadowY, float shadowWidth, float shadowHeight, float pivotX,
145 float pivotY, float rotationX, float rotationY, float alpha, float b orderAlpha, 138 float pivotY, float rotationX, float rotationY, float alpha, float b orderAlpha,
146 float borderInnerShadowAlpha, float contourAlpha, float shadowAlpha, float closeAlpha, 139 float borderInnerShadowAlpha, float contourAlpha, float shadowAlpha, float closeAlpha,
147 float closeBtnWidth, float staticToViewBlend, float borderScale, flo at saturation, 140 float closeBtnWidth, float staticToViewBlend, float borderScale, flo at saturation,
148 float brightness, boolean showToolbar, int defaultThemeColor, 141 float brightness, boolean showToolbar, int defaultThemeColor,
149 int toolbarBackgroundColor, int closeButtonColor, boolean anonymizeT oolbar, 142 int toolbarBackgroundColor, int closeButtonColor, boolean anonymizeT oolbar,
150 int toolbarTextBoxResource, int toolbarTextBoxBackgroundColor, 143 int toolbarTextBoxResource, int toolbarTextBoxBackgroundColor,
151 float toolbarTextBoxAlpha, float toolbarAlpha, float toolbarYOffset, 144 float toolbarTextBoxAlpha, float toolbarAlpha, float toolbarYOffset,
152 float sideBorderScale, boolean attachContent, boolean insetVerticalB order); 145 float sideBorderScale, boolean attachContent, boolean insetVerticalB order);
153 } 146 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698