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

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

Issue 1159113006: [Android] A prototype of the interactive media notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some null checks and hiding the notification when the tab is destroyed. Created 5 years, 5 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.content.Context; 7 import android.content.Context;
8 import android.os.AsyncTask; 8 import android.os.AsyncTask;
9 import android.text.TextUtils; 9 import android.text.TextUtils;
10 10
11 import org.chromium.base.CommandLine; 11 import org.chromium.base.CommandLine;
12 import org.chromium.base.FieldTrialList; 12 import org.chromium.base.FieldTrialList;
13 import org.chromium.base.PowerMonitor; 13 import org.chromium.base.PowerMonitor;
14 import org.chromium.base.SysUtils; 14 import org.chromium.base.SysUtils;
15 import org.chromium.base.ThreadUtils; 15 import org.chromium.base.ThreadUtils;
16 import org.chromium.base.TraceEvent; 16 import org.chromium.base.TraceEvent;
17 import org.chromium.base.VisibleForTesting; 17 import org.chromium.base.VisibleForTesting;
18 import org.chromium.chrome.browser.bookmarkswidget.BookmarkThumbnailWidgetProvid erBase; 18 import org.chromium.chrome.browser.bookmarkswidget.BookmarkThumbnailWidgetProvid erBase;
19 import org.chromium.chrome.browser.crash.CrashFileManager; 19 import org.chromium.chrome.browser.crash.CrashFileManager;
20 import org.chromium.chrome.browser.crash.MinidumpUploadService; 20 import org.chromium.chrome.browser.crash.MinidumpUploadService;
21 import org.chromium.chrome.browser.download.DownloadManagerService; 21 import org.chromium.chrome.browser.download.DownloadManagerService;
22 import org.chromium.chrome.browser.media.MediaNotificationService; 22 import org.chromium.chrome.browser.media.MediaNotificationService;
23 import org.chromium.chrome.browser.media.ui.NotificationMediaPlaybackControls;
23 import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksShim; 24 import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksShim;
24 import org.chromium.chrome.browser.precache.PrecacheLauncher; 25 import org.chromium.chrome.browser.precache.PrecacheLauncher;
25 import org.chromium.chrome.browser.preferences.ChromePreferenceManager; 26 import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
26 import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferencesManager ; 27 import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferencesManager ;
27 import org.chromium.chrome.browser.share.ShareHelper; 28 import org.chromium.chrome.browser.share.ShareHelper;
28 import org.chromium.components.variations.VariationsAssociatedData; 29 import org.chromium.components.variations.VariationsAssociatedData;
29 import org.chromium.content.browser.ChildProcessLauncher; 30 import org.chromium.content.browser.ChildProcessLauncher;
30 31
31 /** 32 /**
32 * Handler for application level tasks to be completed on deferred startup. 33 * Handler for application level tasks to be completed on deferred startup.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 113
113 DownloadManagerService.getDownloadManagerService(application) 114 DownloadManagerService.getDownloadManagerService(application)
114 .clearPendingDownloadNotifications(); 115 .clearPendingDownloadNotifications();
115 116
116 application.initializeSharedClasses(); 117 application.initializeSharedClasses();
117 118
118 ShareHelper.clearSharedScreenshots(application); 119 ShareHelper.clearSharedScreenshots(application);
119 120
120 // Clear any media notifications that existed when Chrome was last kille d. 121 // Clear any media notifications that existed when Chrome was last kille d.
121 MediaNotificationService.clearMediaNotifications(application); 122 MediaNotificationService.clearMediaNotifications(application);
123 NotificationMediaPlaybackControls.hide(Tab.INVALID_TAB_ID);
122 124
123 startModerateBindingManagementIfNeeded(application); 125 startModerateBindingManagementIfNeeded(application);
124 126
125 String customTabsTrialGroupName = FieldTrialList.findFullName("CustomTab s"); 127 String customTabsTrialGroupName = FieldTrialList.findFullName("CustomTab s");
126 if (customTabsTrialGroupName.equals("Disabled")) { 128 if (customTabsTrialGroupName.equals("Disabled")) {
127 ChromePreferenceManager.getInstance(application).setCustomTabsEnable d(false); 129 ChromePreferenceManager.getInstance(application).setCustomTabsEnable d(false);
128 } else if (customTabsTrialGroupName.equals("Enabled") 130 } else if (customTabsTrialGroupName.equals("Enabled")
129 || customTabsTrialGroupName.equals("DisablePrerender")) { 131 || customTabsTrialGroupName.equals("DisablePrerender")) {
130 ChromePreferenceManager.getInstance(application).setCustomTabsEnable d(true); 132 ChromePreferenceManager.getInstance(application).setCustomTabsEnable d(true);
131 } 133 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 173 }
172 174
173 /** 175 /**
174 * @return Whether deferred startup has been completed. 176 * @return Whether deferred startup has been completed.
175 */ 177 */
176 @VisibleForTesting 178 @VisibleForTesting
177 public boolean isDeferredStartupComplete() { 179 public boolean isDeferredStartupComplete() {
178 return mDeferredStartupComplete; 180 return mDeferredStartupComplete;
179 } 181 }
180 } 182 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698