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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java

Issue 1405993005: Enable Theme-Color for Chrome Dev and Canary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cc_omnibox
Patch Set: Rebase Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java
index 46fbb7d61fdca7ee5d06d10454b9faf17a20a36c..800506dbe67c11c01f4cb515c43f96ac75f4dc50 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java
@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.tab;
+import android.content.Context;
import android.graphics.Color;
import android.view.View;
@@ -27,6 +28,7 @@ import org.chromium.chrome.browser.ssl.ConnectionSecurityLevel;
import org.chromium.chrome.browser.util.FeatureUtilities;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.browser.WebContentsObserver;
+import org.chromium.ui.base.DeviceFormFactor;
import java.util.concurrent.TimeUnit;
@@ -227,7 +229,7 @@ public class TabWebContentsObserver extends WebContentsObserver {
}
if (mTab.isShowingInterstitialPage()) color = mTab.getDefaultThemeColor();
if (!FeatureUtilities.isDocumentMode(mTab.getApplicationContext())
- && !isThemeColorEnabledInTabbedMode()) {
+ && !isThemeColorEnabledInTabbedMode(mTab.getApplicationContext())) {
color = mTab.getDefaultThemeColor();
}
if (color == Color.TRANSPARENT) color = mTab.getDefaultThemeColor();
@@ -300,9 +302,12 @@ public class TabWebContentsObserver extends WebContentsObserver {
return mThemeColor;
}
- private static boolean isThemeColorEnabledInTabbedMode() {
+ private static boolean isThemeColorEnabledInTabbedMode(Context context) {
+ if (DeviceFormFactor.isTablet(context)) return false;
CommandLine commandLine = CommandLine.getInstance();
return ChromeVersionInfo.isLocalBuild()
+ || ChromeVersionInfo.isCanaryBuild()
+ || ChromeVersionInfo.isDevBuild()
|| commandLine.hasSwitch(ChromeSwitches.ENABLE_THEME_COLOR_IN_TABBED_MODE);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698