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 #include "chrome/browser/notifications/notification_ui_manager_android.h" | 5 #include "chrome/browser/notifications/notification_ui_manager_android.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/android/context_utils.h" | 10 #include "base/android/context_utils.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 Java_NotificationUIManager_displayNotification( | 183 Java_NotificationUIManager_displayNotification( |
184 env, java_object_.obj(), persistent_notification_id, origin.obj(), | 184 env, java_object_.obj(), persistent_notification_id, origin.obj(), |
185 j_profile_id.obj(), incognito, tag.obj(), title.obj(), body.obj(), | 185 j_profile_id.obj(), incognito, tag.obj(), title.obj(), body.obj(), |
186 notification_icon.obj(), badge.obj(), vibration_pattern.obj(), | 186 notification_icon.obj(), badge.obj(), vibration_pattern.obj(), |
187 notification.timestamp().ToJavaTime(), notification.renotify(), | 187 notification.timestamp().ToJavaTime(), notification.renotify(), |
188 notification.silent(), action_titles.obj(), action_icons.obj()); | 188 notification.silent(), action_titles.obj(), action_icons.obj()); |
189 | 189 |
190 regenerated_notification_infos_[persistent_notification_id] = | 190 regenerated_notification_infos_[persistent_notification_id] = |
191 std::make_pair(origin_url.spec(), notification.tag()); | 191 std::make_pair(origin_url.spec(), notification.tag()); |
192 | |
193 notification.delegate()->Display(); | |
194 } | 192 } |
195 | 193 |
196 void NotificationUIManagerAndroid::Close(const std::string& profile_id, | 194 void NotificationUIManagerAndroid::Close(const std::string& profile_id, |
197 const std::string& notification_id) { | 195 const std::string& notification_id) { |
198 int64_t persistent_notification_id = 0; | 196 int64_t persistent_notification_id = 0; |
199 | 197 |
200 // TODO(peter): Use the |delegate_id| directly when notification ids are being | 198 // TODO(peter): Use the |delegate_id| directly when notification ids are being |
201 // generated by content/ instead of us. | 199 // generated by content/ instead of us. |
202 if (!base::StringToInt64(notification_id, &persistent_notification_id)) { | 200 if (!base::StringToInt64(notification_id, &persistent_notification_id)) { |
203 LOG(WARNING) << "Unable to decode notification_id " << notification_id; | 201 LOG(WARNING) << "Unable to decode notification_id " << notification_id; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 } | 234 } |
237 | 235 |
238 bool NotificationUIManagerAndroid::SupportsNotificationCenter() const { | 236 bool NotificationUIManagerAndroid::SupportsNotificationCenter() const { |
239 return true; | 237 return true; |
240 } | 238 } |
241 | 239 |
242 bool NotificationUIManagerAndroid::RegisterNotificationPlatformBridge( | 240 bool NotificationUIManagerAndroid::RegisterNotificationPlatformBridge( |
243 JNIEnv* env) { | 241 JNIEnv* env) { |
244 return RegisterNativesImpl(env); | 242 return RegisterNativesImpl(env); |
245 } | 243 } |
OLD | NEW |