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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java

Issue 2742983002: 📺 Move VideoPersistence to ChromeActivity. (Closed)
Patch Set: Created 3 years, 9 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; 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 import org.chromium.chrome.browser.download.DownloadUtils; 78 import org.chromium.chrome.browser.download.DownloadUtils;
79 import org.chromium.chrome.browser.firstrun.ForcedSigninProcessor; 79 import org.chromium.chrome.browser.firstrun.ForcedSigninProcessor;
80 import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; 80 import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager;
81 import org.chromium.chrome.browser.gsa.ContextReporter; 81 import org.chromium.chrome.browser.gsa.ContextReporter;
82 import org.chromium.chrome.browser.gsa.GSAAccountChangeListener; 82 import org.chromium.chrome.browser.gsa.GSAAccountChangeListener;
83 import org.chromium.chrome.browser.gsa.GSAState; 83 import org.chromium.chrome.browser.gsa.GSAState;
84 import org.chromium.chrome.browser.help.HelpAndFeedback; 84 import org.chromium.chrome.browser.help.HelpAndFeedback;
85 import org.chromium.chrome.browser.history.HistoryManagerUtils; 85 import org.chromium.chrome.browser.history.HistoryManagerUtils;
86 import org.chromium.chrome.browser.infobar.InfoBarContainer; 86 import org.chromium.chrome.browser.infobar.InfoBarContainer;
87 import org.chromium.chrome.browser.init.AsyncInitializationActivity; 87 import org.chromium.chrome.browser.init.AsyncInitializationActivity;
88 import org.chromium.chrome.browser.media.VideoPersister;
88 import org.chromium.chrome.browser.metrics.LaunchMetrics; 89 import org.chromium.chrome.browser.metrics.LaunchMetrics;
89 import org.chromium.chrome.browser.metrics.StartupMetrics; 90 import org.chromium.chrome.browser.metrics.StartupMetrics;
90 import org.chromium.chrome.browser.metrics.UmaSessionStats; 91 import org.chromium.chrome.browser.metrics.UmaSessionStats;
91 import org.chromium.chrome.browser.metrics.UmaUtils; 92 import org.chromium.chrome.browser.metrics.UmaUtils;
92 import org.chromium.chrome.browser.metrics.WebApkUma; 93 import org.chromium.chrome.browser.metrics.WebApkUma;
93 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; 94 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils;
94 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; 95 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
95 import org.chromium.chrome.browser.nfc.BeamController; 96 import org.chromium.chrome.browser.nfc.BeamController;
96 import org.chromium.chrome.browser.nfc.BeamProvider; 97 import org.chromium.chrome.browser.nfc.BeamProvider;
97 import org.chromium.chrome.browser.ntp.NewTabPage; 98 import org.chromium.chrome.browser.ntp.NewTabPage;
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 super.onResumeWithNative(); 806 super.onResumeWithNative();
806 markSessionResume(); 807 markSessionResume();
807 RecordUserAction.record("MobileComeToForeground"); 808 RecordUserAction.record("MobileComeToForeground");
808 809
809 if (getActivityTab() != null) { 810 if (getActivityTab() != null) {
810 LaunchMetrics.commitLaunchMetrics(getActivityTab().getWebContents()) ; 811 LaunchMetrics.commitLaunchMetrics(getActivityTab().getWebContents()) ;
811 } 812 }
812 FeatureUtilities.setCustomTabVisible(isCustomTab()); 813 FeatureUtilities.setCustomTabVisible(isCustomTab());
813 FeatureUtilities.setIsInMultiWindowMode( 814 FeatureUtilities.setIsInMultiWindowMode(
814 MultiWindowUtils.getInstance().isInMultiWindowMode(this)); 815 MultiWindowUtils.getInstance().isInMultiWindowMode(this));
816
817 VideoPersister.getInstance().stopPersist(this);
815 } 818 }
816 819
817 @Override 820 @Override
821 protected void onUserLeaveHint() {
822 super.onUserLeaveHint();
823 VideoPersister.getInstance().attemptPersist(this);
824 }
825
826 @Override
818 public void onPauseWithNative() { 827 public void onPauseWithNative() {
819 RecordUserAction.record("MobileGoToBackground"); 828 RecordUserAction.record("MobileGoToBackground");
820 Tab tab = getActivityTab(); 829 Tab tab = getActivityTab();
821 if (tab != null) { 830 if (tab != null) {
822 getTabContentManager().cacheTabThumbnail(tab); 831 getTabContentManager().cacheTabThumbnail(tab);
823 } 832 }
824 VrShellDelegate.maybePauseVR(this); 833 VrShellDelegate.maybePauseVR(this);
825 markSessionEnd(); 834 markSessionEnd();
826 super.onPauseWithNative(); 835 super.onPauseWithNative();
827 } 836 }
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2096 * draw over VR contents should be hidden in this call. 2105 * draw over VR contents should be hidden in this call.
2097 */ 2106 */
2098 public void onEnterVR() {} 2107 public void onEnterVR() {}
2099 2108
2100 /** 2109 /**
2101 * Called when VR mode using this activity is exited. Any state set for VR s hould be restored 2110 * Called when VR mode using this activity is exited. Any state set for VR s hould be restored
2102 * in this call, including showing 2D UI that was hidden. 2111 * in this call, including showing 2D UI that was hidden.
2103 */ 2112 */
2104 public void onExitVR() {} 2113 public void onExitVR() {}
2105 } 2114 }
OLDNEW
« no previous file with comments | « chrome/android/java/AndroidManifest.xml ('k') | chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698