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

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

Issue 2611333002: Android web notifications: Schedule job instead of starting service (N+) (Closed)
Patch Set: Created 3 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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.content.Intent;
8
7 /** 9 /**
8 * Constants used in more than a single Notification class, e.g. intents and ext ra names. 10 * Constants used in more than a single Notification class, e.g. intents and ext ra names.
9 */ 11 */
10 public class NotificationConstants { 12 public class NotificationConstants {
11 // These actions have to be synchronized with the receiver defined in Androi dManifest.xml. 13 // These actions have to be synchronized with the receiver defined in Androi dManifest.xml.
12 static final String ACTION_CLICK_NOTIFICATION = 14 static final String ACTION_CLICK_NOTIFICATION =
13 "org.chromium.chrome.browser.notifications.CLICK_NOTIFICATION"; 15 "org.chromium.chrome.browser.notifications.CLICK_NOTIFICATION";
14 static final String ACTION_CLOSE_NOTIFICATION = 16 static final String ACTION_CLOSE_NOTIFICATION =
15 "org.chromium.chrome.browser.notifications.CLOSE_NOTIFICATION"; 17 "org.chromium.chrome.browser.notifications.CLOSE_NOTIFICATION";
16 18
17 /** 19 /**
18 * Name of the Intent extra set by the framework when a notification prefere nces intent has 20 * Name of the Intent extra set by the framework when a notification prefere nces intent has
19 * been triggered from there, which could be one of the setting gears in sys tem UI. 21 * been triggered from there, which could be one of the setting gears in sys tem UI.
20 */ 22 */
21 static final String EXTRA_NOTIFICATION_TAG = "notification_tag"; 23 static final String EXTRA_NOTIFICATION_TAG = "notification_tag";
22 24
23 /** 25 /**
24 * Names of the Intent extras used for Intents related to notifications. The se intents are set 26 * Names of the Intent extras used for Intents related to notifications. The se intents are set
25 * and owned by Chromium. 27 * and owned by Chromium.
28 *
29 * When adding a new extra, as well as setting it on the intent in Notificat ionPlatformBridge,
30 * it *must* also be set in {@link NotificationService.Receiver#getJobExtras FromIntent(Intent)}
26 */ 31 */
27 static final String EXTRA_NOTIFICATION_ID = "notification_id"; 32 static final String EXTRA_NOTIFICATION_ID = "notification_id";
28 static final String EXTRA_NOTIFICATION_INFO_ORIGIN = "notification_info_orig in"; 33 static final String EXTRA_NOTIFICATION_INFO_ORIGIN = "notification_info_orig in";
29 static final String EXTRA_NOTIFICATION_INFO_PROFILE_ID = "notification_info_ profile_id"; 34 static final String EXTRA_NOTIFICATION_INFO_PROFILE_ID = "notification_info_ profile_id";
30 static final String EXTRA_NOTIFICATION_INFO_PROFILE_INCOGNITO = 35 static final String EXTRA_NOTIFICATION_INFO_PROFILE_INCOGNITO =
31 "notification_info_profile_incognito"; 36 "notification_info_profile_incognito";
32 static final String EXTRA_NOTIFICATION_INFO_TAG = "notification_info_tag"; 37 static final String EXTRA_NOTIFICATION_INFO_TAG = "notification_info_tag";
33 static final String EXTRA_NOTIFICATION_INFO_ACTION_INDEX = "notification_inf o_action_index"; 38 static final String EXTRA_NOTIFICATION_INFO_ACTION_INDEX = "notification_inf o_action_index";
34 static final String EXTRA_NOTIFICATION_INFO_WEBAPK_PACKAGE = "notification_i nfo_webapk_package"; 39 static final String EXTRA_NOTIFICATION_INFO_WEBAPK_PACKAGE = "notification_i nfo_webapk_package";
40 static final String EXTRA_NOTIFICATION_REPLY = "notification_reply";
41 static final String EXTRA_NOTIFICATION_ACTION = "notification_action";
35 42
36 /** 43 /**
37 * Unique identifier for a single sync notification. Since the notification ID is reused, 44 * Unique identifier for a single sync notification. Since the notification ID is reused,
38 * old notifications will be overwritten. 45 * old notifications will be overwritten.
39 */ 46 */
40 public static final int NOTIFICATION_ID_SYNC = 1; 47 public static final int NOTIFICATION_ID_SYNC = 1;
41 /** 48 /**
42 * Unique identifier for the "Signed in to Chrome" notification. 49 * Unique identifier for the "Signed in to Chrome" notification.
43 */ 50 */
44 @SuppressWarnings("unused") 51 @SuppressWarnings("unused")
45 public static final int NOTIFICATION_ID_SIGNED_IN = 2; 52 public static final int NOTIFICATION_ID_SIGNED_IN = 2;
46 /** 53 /**
47 * Unique identifier for the Physical Web notification. 54 * Unique identifier for the Physical Web notification.
48 */ 55 */
49 public static final int NOTIFICATION_ID_PHYSICAL_WEB = 3; 56 public static final int NOTIFICATION_ID_PHYSICAL_WEB = 3;
50 57
51 /** 58 /**
52 * Separator used to separate the notification origin from additional data s uch as the 59 * Separator used to separate the notification origin from additional data s uch as the
53 * developer specified tag. 60 * developer specified tag.
54 */ 61 */
55 static final String NOTIFICATION_TAG_SEPARATOR = ";"; 62 static final String NOTIFICATION_TAG_SEPARATOR = ";";
56 63
57 /** 64 /**
58 * Key for retrieving the results of user input from notification text actio n intents. 65 * Key for retrieving the results of user input from notification text actio n intents.
59 */ 66 */
60 static final String KEY_TEXT_REPLY = "key_text_reply"; 67 static final String KEY_TEXT_REPLY = "key_text_reply";
61 } 68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698