| 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 | 8 |
| 9 #include "base/android/context_utils.h" | 9 #include "base/android/context_utils.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 ScopedJavaLocalRef<jintArray> vibration_pattern = | 146 ScopedJavaLocalRef<jintArray> vibration_pattern = |
| 147 base::android::ToJavaIntArray(env, notification.vibration_pattern()); | 147 base::android::ToJavaIntArray(env, notification.vibration_pattern()); |
| 148 | 148 |
| 149 ScopedJavaLocalRef<jstring> profile_id = | 149 ScopedJavaLocalRef<jstring> profile_id = |
| 150 ConvertUTF8ToJavaString(env, profile->GetPath().BaseName().value()); | 150 ConvertUTF8ToJavaString(env, profile->GetPath().BaseName().value()); |
| 151 | 151 |
| 152 Java_NotificationUIManager_displayNotification( | 152 Java_NotificationUIManager_displayNotification( |
| 153 env, java_object_.obj(), persistent_notification_id, origin.obj(), | 153 env, java_object_.obj(), persistent_notification_id, origin.obj(), |
| 154 profile_id.obj(), profile->IsOffTheRecord(), tag.obj(), title.obj(), | 154 profile_id.obj(), profile->IsOffTheRecord(), tag.obj(), title.obj(), |
| 155 body.obj(), icon.obj(), vibration_pattern.obj(), | 155 body.obj(), icon.obj(), vibration_pattern.obj(), |
| 156 notification.timestamp().ToJavaTime(), notification.silent(), | 156 notification.timestamp().ToJavaTime(), notification.renotify(), |
| 157 action_titles.obj()); | 157 notification.silent(), action_titles.obj()); |
| 158 | 158 |
| 159 regenerated_notification_infos_[persistent_notification_id] = | 159 regenerated_notification_infos_[persistent_notification_id] = |
| 160 std::make_pair(origin_url.spec(), notification.tag()); | 160 std::make_pair(origin_url.spec(), notification.tag()); |
| 161 | 161 |
| 162 notification.delegate()->Display(); | 162 notification.delegate()->Display(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 bool NotificationUIManagerAndroid::Update(const Notification& notification, | 165 bool NotificationUIManagerAndroid::Update(const Notification& notification, |
| 166 Profile* profile) { | 166 Profile* profile) { |
| 167 NOTREACHED(); | 167 NOTREACHED(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 return false; | 233 return false; |
| 234 } | 234 } |
| 235 | 235 |
| 236 void NotificationUIManagerAndroid::CancelAll() { | 236 void NotificationUIManagerAndroid::CancelAll() { |
| 237 NOTREACHED(); | 237 NOTREACHED(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 bool NotificationUIManagerAndroid::RegisterNotificationUIManager(JNIEnv* env) { | 240 bool NotificationUIManagerAndroid::RegisterNotificationUIManager(JNIEnv* env) { |
| 241 return RegisterNativesImpl(env); | 241 return RegisterNativesImpl(env); |
| 242 } | 242 } |
| OLD | NEW |