OLD | NEW |
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.app.IntentService; | 7 import android.app.IntentService; |
8 import android.content.BroadcastReceiver; | 8 import android.content.BroadcastReceiver; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.Intent; | 10 import android.content.Intent; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 /** | 47 /** |
48 * Called when a Notification has been interacted with by the user. If we ca
n verify that | 48 * Called when a Notification has been interacted with by the user. If we ca
n verify that |
49 * the Intent has a notification Id, start Chrome (if needed) on the UI thre
ad. | 49 * the Intent has a notification Id, start Chrome (if needed) on the UI thre
ad. |
50 * | 50 * |
51 * @param intent The intent containing the specific information. | 51 * @param intent The intent containing the specific information. |
52 */ | 52 */ |
53 @Override | 53 @Override |
54 public void onHandleIntent(final Intent intent) { | 54 public void onHandleIntent(final Intent intent) { |
55 if (!intent.hasExtra(NotificationConstants.EXTRA_NOTIFICATION_ID)) retur
n; | 55 if (!intent.hasExtra(NotificationConstants.EXTRA_PERSISTENT_NOTIFICATION
_ID) |
| 56 || !intent.hasExtra(NotificationConstants.EXTRA_NOTIFICATION_INF
O_ORIGIN) |
| 57 || !intent.hasExtra(NotificationConstants.EXTRA_NOTIFICATION_INF
O_TAG)) { |
| 58 return; |
| 59 } |
56 | 60 |
57 ThreadUtils.runOnUiThread(new Runnable() { | 61 ThreadUtils.runOnUiThread(new Runnable() { |
58 @Override | 62 @Override |
59 public void run() { | 63 public void run() { |
60 dispatchIntentOnUIThread(intent); | 64 dispatchIntentOnUIThread(intent); |
61 } | 65 } |
62 }); | 66 }); |
63 } | 67 } |
64 | 68 |
65 /** | 69 /** |
(...skipping 24 matching lines...) Expand all Loading... |
90 | 94 |
91 // TODO(peter): The native side needs to tell us when executing the
event has | 95 // TODO(peter): The native side needs to tell us when executing the
event has |
92 // finished, so that we can forcefully stop the service. | 96 // finished, so that we can forcefully stop the service. |
93 | 97 |
94 } catch (ProcessInitException e) { | 98 } catch (ProcessInitException e) { |
95 Log.e(TAG, "Unable to start the browser process.", e); | 99 Log.e(TAG, "Unable to start the browser process.", e); |
96 System.exit(-1); | 100 System.exit(-1); |
97 } | 101 } |
98 } | 102 } |
99 } | 103 } |
OLD | NEW |