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

Side by Side Diff: chrome/browser/notifications/notification_ui_manager_android.cc

Issue 1388483002: Implement the Notification `timestamp` property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 #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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
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(), notification.silent(), 155 body.obj(), icon.obj(), vibration_pattern.obj(),
156 notification.timestamp().ToJavaTime(), notification.silent(),
156 action_titles.obj()); 157 action_titles.obj());
157 158
158 regenerated_notification_infos_[persistent_notification_id] = 159 regenerated_notification_infos_[persistent_notification_id] =
159 std::make_pair(origin_url.spec(), notification.tag()); 160 std::make_pair(origin_url.spec(), notification.tag());
160 161
161 notification.delegate()->Display(); 162 notification.delegate()->Display();
162 } 163 }
163 164
164 bool NotificationUIManagerAndroid::Update(const Notification& notification, 165 bool NotificationUIManagerAndroid::Update(const Notification& notification,
165 Profile* profile) { 166 Profile* profile) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 return false; 233 return false;
233 } 234 }
234 235
235 void NotificationUIManagerAndroid::CancelAll() { 236 void NotificationUIManagerAndroid::CancelAll() {
236 NOTREACHED(); 237 NOTREACHED();
237 } 238 }
238 239
239 bool NotificationUIManagerAndroid::RegisterNotificationUIManager(JNIEnv* env) { 240 bool NotificationUIManagerAndroid::RegisterNotificationUIManager(JNIEnv* env) {
240 return RegisterNativesImpl(env); 241 return RegisterNativesImpl(env);
241 } 242 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698