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/toolbar/ToolbarModelImpl.java

Issue 2862113003: [Home] Disable theme colors in toolbar (Closed)
Patch Set: jk 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 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.toolbar; 5 package org.chromium.chrome.browser.toolbar;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.support.annotation.Nullable; 8 import android.support.annotation.Nullable;
9 import android.text.TextUtils; 9 import android.text.TextUtils;
10 10
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 mPrimaryColor = color; 146 mPrimaryColor = color;
147 Context context = ContextUtils.getApplicationContext(); 147 Context context = ContextUtils.getApplicationContext();
148 mIsUsingBrandColor = !isIncognito() 148 mIsUsingBrandColor = !isIncognito()
149 && mPrimaryColor != ApiCompatibilityUtils.getColor(context.getRe sources(), 149 && mPrimaryColor != ApiCompatibilityUtils.getColor(context.getRe sources(),
150 R.color.default_primary_color) 150 R.color.default_primary_color)
151 && getTab() != null && !getTab().isNativePage(); 151 && getTab() != null && !getTab().isNativePage();
152 } 152 }
153 153
154 @Override 154 @Override
155 public int getPrimaryColor() { 155 public int getPrimaryColor() {
156 if (mBottomSheet != null && mBottomSheet.isSheetOpen() 156 if (mBottomSheet != null) {
157 && mBottomSheet.getTargetSheetState() != BottomSheet.SHEET_STATE _PEEK) {
158 int colorId = 157 int colorId =
159 isIncognito() ? R.color.incognito_primary_color : R.color.de fault_primary_color; 158 isIncognito() ? R.color.incognito_primary_color : R.color.de fault_primary_color;
160 return ApiCompatibilityUtils.getColor( 159 return ApiCompatibilityUtils.getColor(
161 ContextUtils.getApplicationContext().getResources(), colorId ); 160 ContextUtils.getApplicationContext().getResources(), colorId );
162 } 161 }
163 return mPrimaryColor; 162 return mPrimaryColor;
164 } 163 }
165 164
166 @Override 165 @Override
167 public boolean isUsingBrandColor() { 166 public boolean isUsingBrandColor() {
168 return mIsUsingBrandColor; 167 return mIsUsingBrandColor && mBottomSheet == null;
169 } 168 }
170 } 169 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698