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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/download/MockDownloadNotificationService.java

Issue 2730243002: Update the download summary icon (Closed)
Patch Set: Addressed nit 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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationCompatBuilder.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.download; 5 package org.chromium.chrome.browser.download;
6 6
7 import android.app.Notification; 7 import android.app.Notification;
8 import android.content.Context; 8 import android.content.Context;
9 import android.util.Pair;
9 10
10 import org.chromium.base.BuildInfo; 11 import org.chromium.base.BuildInfo;
11 import org.chromium.base.ThreadUtils; 12 import org.chromium.base.ThreadUtils;
12 13
13 import java.util.ArrayList; 14 import java.util.ArrayList;
14 import java.util.List; 15 import java.util.List;
15 import java.util.concurrent.Callable; 16 import java.util.concurrent.Callable;
16 17
17 /** 18 /**
18 * Mock class to DownloadNotificationService for testing purpose. 19 * Mock class to DownloadNotificationService for testing purpose.
(...skipping 29 matching lines...) Expand all
48 // Cancelling notifications here is synchronous, so we don't really have to worry about 49 // Cancelling notifications here is synchronous, so we don't really have to worry about
49 // {@code notificationIdToIgnore}, but address it properly anyway. 50 // {@code notificationIdToIgnore}, but address it properly anyway.
50 if (mNotificationIds.size() == 1 && notificationIdToIgnore != null) { 51 if (mNotificationIds.size() == 1 && notificationIdToIgnore != null) {
51 return !mNotificationIds.contains(notificationIdToIgnore); 52 return !mNotificationIds.contains(notificationIdToIgnore);
52 } 53 }
53 54
54 return !mNotificationIds.isEmpty(); 55 return !mNotificationIds.isEmpty();
55 } 56 }
56 57
57 @Override 58 @Override
59 void updateSummaryIcon(
60 int removedNotificationId, Pair<Integer, Notification> addedNotifica tion) {}
61
62 @Override
58 void cancelSummaryNotification() {} 63 void cancelSummaryNotification() {}
59 64
60 @Override 65 @Override
61 void updateNotification(int id, Notification notification) { 66 void updateNotification(int id, Notification notification) {
62 if (!mNotificationIds.contains(id)) { 67 if (!mNotificationIds.contains(id)) {
63 mNotificationIds.add(id); 68 mNotificationIds.add(id);
64 mLastNotificationId = id; 69 mLastNotificationId = id;
65 } 70 }
66 } 71 }
67 72
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 public void notifyDownloadCanceled(final String downloadGuid) { 139 public void notifyDownloadCanceled(final String downloadGuid) {
135 ThreadUtils.runOnUiThreadBlocking(new Runnable() { 140 ThreadUtils.runOnUiThreadBlocking(new Runnable() {
136 @Override 141 @Override
137 public void run() { 142 public void run() {
138 MockDownloadNotificationService.super.notifyDownloadCanceled(dow nloadGuid); 143 MockDownloadNotificationService.super.notifyDownloadCanceled(dow nloadGuid);
139 } 144 }
140 }); 145 });
141 } 146 }
142 } 147 }
143 148
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationCompatBuilder.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698