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; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
9 import android.app.Activity; | 9 import android.app.Activity; |
10 import android.app.ActivityManager; | 10 import android.app.ActivityManager; |
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1831 public void onOverviewModeFinishedHiding() { | 1831 public void onOverviewModeFinishedHiding() { |
1832 if (getAssistStatusHandler() != null) getAssistStatusHandler().updateAss istState(); | 1832 if (getAssistStatusHandler() != null) getAssistStatusHandler().updateAss istState(); |
1833 if (getActivityTab() != null) { | 1833 if (getActivityTab() != null) { |
1834 setStatusBarColor(getActivityTab(), getActivityTab().getThemeColor() ); | 1834 setStatusBarColor(getActivityTab(), getActivityTab().getThemeColor() ); |
1835 } | 1835 } |
1836 } | 1836 } |
1837 | 1837 |
1838 @Override | 1838 @Override |
1839 protected void setStatusBarColor(Tab tab, int color) { | 1839 protected void setStatusBarColor(Tab tab, int color) { |
1840 if (DeviceFormFactor.isTablet(getApplicationContext())) return; | 1840 if (DeviceFormFactor.isTablet(getApplicationContext())) return; |
1841 | |
1842 // If Chrome Home is enabled, the super of this function is not called. | |
gone
2017/04/06 21:32:29
why?
mdjones
2017/04/07 15:31:17
Done.
| |
1843 if (getBottomSheet() != null) { | |
1844 color = ApiCompatibilityUtils.getColor(getResources(), R.color.defau lt_primary_color); | |
1845 getBottomSheet().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STA TUS_BAR); | |
1846 | |
1847 // Special case the incognito NTP and the tab switcher. | |
1848 if ((tab != null && NewTabPage.isNTPUrl(tab.getUrl()) && tab.isIncog nito()) | |
1849 || isInOverviewMode()) { | |
1850 color = Color.BLACK; | |
1851 } | |
1852 ApiCompatibilityUtils.setStatusBarColor(getWindow(), color); | |
1853 return; | |
1854 } | |
1855 | |
1841 super.setStatusBarColor(tab, isInOverviewMode() ? Color.BLACK : color); | 1856 super.setStatusBarColor(tab, isInOverviewMode() ? Color.BLACK : color); |
1842 } | 1857 } |
1843 | 1858 |
1844 @Override | 1859 @Override |
1845 public void onMultiWindowModeChanged(boolean isInMultiWindowMode) { | 1860 public void onMultiWindowModeChanged(boolean isInMultiWindowMode) { |
1846 super.onMultiWindowModeChanged(isInMultiWindowMode); | 1861 super.onMultiWindowModeChanged(isInMultiWindowMode); |
1847 if (!FeatureUtilities.isTabModelMergingEnabled()) return; | 1862 if (!FeatureUtilities.isTabModelMergingEnabled()) return; |
1848 if (!isInMultiWindowMode) { | 1863 if (!isInMultiWindowMode) { |
1849 // If the activity is currently resumed when multi-window mode is ex ited, try to merge | 1864 // If the activity is currently resumed when multi-window mode is ex ited, try to merge |
1850 // tabs from the other activity instance. | 1865 // tabs from the other activity instance. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1971 | 1986 |
1972 ActivityManager manager = (ActivityManager) getSystemService(Context.ACT IVITY_SERVICE); | 1987 ActivityManager manager = (ActivityManager) getSystemService(Context.ACT IVITY_SERVICE); |
1973 for (AppTask task : manager.getAppTasks()) { | 1988 for (AppTask task : manager.getAppTasks()) { |
1974 RecentTaskInfo info = DocumentUtils.getTaskInfoFromTask(task); | 1989 RecentTaskInfo info = DocumentUtils.getTaskInfoFromTask(task); |
1975 if (info == null) continue; | 1990 if (info == null) continue; |
1976 if (info.id == sMergedInstanceTaskId) return true; | 1991 if (info.id == sMergedInstanceTaskId) return true; |
1977 } | 1992 } |
1978 return false; | 1993 return false; |
1979 } | 1994 } |
1980 } | 1995 } |
OLD | NEW |