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

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

Issue 2831383002: [Android O] Refactor channel definitions into new class (Closed)
Patch Set: Created 3 years, 8 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.notifications; 5 package org.chromium.chrome.browser.notifications;
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.content.res.Resources; 9 import android.content.res.Resources;
10 import android.graphics.Bitmap; 10 import android.graphics.Bitmap;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 } 136 }
137 addActionButtons(bigView); 137 addActionButtons(bigView);
138 configureSettingsButton(bigView); 138 configureSettingsButton(bigView);
139 139
140 // Note: under the hood this is not a NotificationCompat builder so be m indful of the 140 // Note: under the hood this is not a NotificationCompat builder so be m indful of the
141 // API level of methods you call on the builder. 141 // API level of methods you call on the builder.
142 // TODO(crbug.com/697104) We should probably use a Compat builder. 142 // TODO(crbug.com/697104) We should probably use a Compat builder.
143 ChromeNotificationBuilder builder = 143 ChromeNotificationBuilder builder =
144 NotificationBuilderFactory.createChromeNotificationBuilder( 144 NotificationBuilderFactory.createChromeNotificationBuilder(
145 false /* preferCompat */, ChannelsInitializer.CHANNEL_ID _SITES); 145 false /* preferCompat */, ChannelDefinitions.CHANNEL_ID_ SITES);
146 builder.setTicker(mTickerText); 146 builder.setTicker(mTickerText);
147 builder.setContentIntent(mContentIntent); 147 builder.setContentIntent(mContentIntent);
148 builder.setDeleteIntent(mDeleteIntent); 148 builder.setDeleteIntent(mDeleteIntent);
149 builder.setDefaults(mDefaults); 149 builder.setDefaults(mDefaults);
150 builder.setVibrate(mVibratePattern); 150 builder.setVibrate(mVibratePattern);
151 builder.setWhen(mTimestamp); 151 builder.setWhen(mTimestamp);
152 builder.setOnlyAlertOnce(!mRenotify); 152 builder.setOnlyAlertOnce(!mRenotify);
153 builder.setContent(compactView); 153 builder.setContent(compactView);
154 154
155 // Some things are duplicated in the builder to ensure the notification shows correctly on 155 // Some things are duplicated in the builder to ensure the notification shows correctly on
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 317 }
318 318
319 /** 319 /**
320 * Whether to use the Material look and feel or fall back to Holo. 320 * Whether to use the Material look and feel or fall back to Holo.
321 */ 321 */
322 @VisibleForTesting 322 @VisibleForTesting
323 static boolean useMaterial() { 323 static boolean useMaterial() {
324 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; 324 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
325 } 325 }
326 } 326 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698