| 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.SearchManager; | 10 import android.app.SearchManager; |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 PartnerBrowserCustomizations.setOnInitializeAsyncFinished(new Runnab
le() { | 697 PartnerBrowserCustomizations.setOnInitializeAsyncFinished(new Runnab
le() { |
| 698 @Override | 698 @Override |
| 699 public void run() { | 699 public void run() { |
| 700 if (PartnerBrowserCustomizations.isIncognitoDisabled()) { | 700 if (PartnerBrowserCustomizations.isIncognitoDisabled()) { |
| 701 terminateIncognitoSession(); | 701 terminateIncognitoSession(); |
| 702 } | 702 } |
| 703 } | 703 } |
| 704 }); | 704 }); |
| 705 } | 705 } |
| 706 if (mCompositorViewHolder != null) mCompositorViewHolder.onStart(); | 706 if (mCompositorViewHolder != null) mCompositorViewHolder.onStart(); |
| 707 mSnackbarManager.onStart(); |
| 707 | 708 |
| 708 // Explicitly call checkAccessibility() so things are initialized correc
tly when Chrome has | 709 // Explicitly call checkAccessibility() so things are initialized correc
tly when Chrome has |
| 709 // been re-started after closing due to the last tab being closed when h
omepage is enabled. | 710 // been re-started after closing due to the last tab being closed when h
omepage is enabled. |
| 710 // See crbug.com/541546. | 711 // See crbug.com/541546. |
| 711 checkAccessibility(); | 712 checkAccessibility(); |
| 712 } | 713 } |
| 713 | 714 |
| 714 @Override | 715 @Override |
| 715 public void onStop() { | 716 public void onStop() { |
| 716 super.onStop(); | 717 super.onStop(); |
| 717 if (mContextReporter != null) mContextReporter.disable(); | 718 if (mContextReporter != null) mContextReporter.disable(); |
| 718 | 719 |
| 719 // We want to refresh partner browser provider every onStart(). | 720 // We want to refresh partner browser provider every onStart(). |
| 720 mPartnerBrowserRefreshNeeded = true; | 721 mPartnerBrowserRefreshNeeded = true; |
| 721 if (mCompositorViewHolder != null) mCompositorViewHolder.onStop(); | 722 if (mCompositorViewHolder != null) mCompositorViewHolder.onStop(); |
| 723 mSnackbarManager.onStop(); |
| 722 } | 724 } |
| 723 | 725 |
| 724 @Override | 726 @Override |
| 725 public void onPause() { | |
| 726 super.onPause(); | |
| 727 mSnackbarManager.dismissAllSnackbars(false); | |
| 728 } | |
| 729 | |
| 730 @Override | |
| 731 @TargetApi(Build.VERSION_CODES.M) | 727 @TargetApi(Build.VERSION_CODES.M) |
| 732 public void onProvideAssistContent(AssistContent outContent) { | 728 public void onProvideAssistContent(AssistContent outContent) { |
| 733 if (getAssistStatusHandler() == null || !getAssistStatusHandler().isAssi
stSupported()) { | 729 if (getAssistStatusHandler() == null || !getAssistStatusHandler().isAssi
stSupported()) { |
| 734 // No information is provided in incognito mode. | 730 // No information is provided in incognito mode. |
| 735 return; | 731 return; |
| 736 } | 732 } |
| 737 Tab tab = getActivityTab(); | 733 Tab tab = getActivityTab(); |
| 738 if (tab != null && !isInOverviewMode()) { | 734 if (tab != null && !isInOverviewMode()) { |
| 739 outContent.setWebUri(Uri.parse(tab.getUrl())); | 735 outContent.setWebUri(Uri.parse(tab.getUrl())); |
| 740 } | 736 } |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1610 public static int getThemeId() { | 1606 public static int getThemeId() { |
| 1611 boolean useLowEndTheme = | 1607 boolean useLowEndTheme = |
| 1612 SysUtils.isLowEndDevice() && Build.VERSION.SDK_INT >= Build.VERS
ION_CODES.LOLLIPOP; | 1608 SysUtils.isLowEndDevice() && Build.VERSION.SDK_INT >= Build.VERS
ION_CODES.LOLLIPOP; |
| 1613 return (useLowEndTheme ? R.style.MainTheme_LowEnd : R.style.MainTheme); | 1609 return (useLowEndTheme ? R.style.MainTheme_LowEnd : R.style.MainTheme); |
| 1614 } | 1610 } |
| 1615 | 1611 |
| 1616 private void setLowEndTheme() { | 1612 private void setLowEndTheme() { |
| 1617 if (getThemeId() == R.style.MainTheme_LowEnd) setTheme(R.style.MainTheme
_LowEnd); | 1613 if (getThemeId() == R.style.MainTheme_LowEnd) setTheme(R.style.MainTheme
_LowEnd); |
| 1618 } | 1614 } |
| 1619 } | 1615 } |
| OLD | NEW |