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

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

Issue 1054573002: Implement support for notification.vibrate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/jni_array.h" 9 #include "base/android/jni_array.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 env, notification.title()); 111 env, notification.title());
112 ScopedJavaLocalRef<jstring> body = ConvertUTF16ToJavaString( 112 ScopedJavaLocalRef<jstring> body = ConvertUTF16ToJavaString(
113 env, notification.message()); 113 env, notification.message());
114 114
115 ScopedJavaLocalRef<jobject> icon; 115 ScopedJavaLocalRef<jobject> icon;
116 116
117 SkBitmap icon_bitmap = notification.icon().AsBitmap(); 117 SkBitmap icon_bitmap = notification.icon().AsBitmap();
118 if (!icon_bitmap.isNull()) 118 if (!icon_bitmap.isNull())
119 icon = gfx::ConvertToJavaBitmap(&icon_bitmap); 119 icon = gfx::ConvertToJavaBitmap(&icon_bitmap);
120 120
121 ScopedJavaLocalRef<jintArray> vibrate_pattern =
122 base::android::ToJavaIntArray(env, notification.vibrate_pattern());
123
121 Java_NotificationUIManager_displayNotification( 124 Java_NotificationUIManager_displayNotification(
122 env, 125 env,
123 java_object_.obj(), 126 java_object_.obj(),
124 persistent_notification_id, 127 persistent_notification_id,
125 origin.obj(), 128 origin.obj(),
126 tag.obj(), 129 tag.obj(),
127 title.obj(), 130 title.obj(),
128 body.obj(), 131 body.obj(),
129 icon.obj(), 132 icon.obj(),
133 vibrate_pattern.obj(),
130 notification.silent()); 134 notification.silent());
131 135
132 regenerated_notification_infos_[persistent_notification_id] = 136 regenerated_notification_infos_[persistent_notification_id] =
133 std::make_pair(origin_url.spec(), notification.tag()); 137 std::make_pair(origin_url.spec(), notification.tag());
134 138
135 notification.delegate()->Display(); 139 notification.delegate()->Display();
136 } 140 }
137 141
138 bool NotificationUIManagerAndroid::Update(const Notification& notification, 142 bool NotificationUIManagerAndroid::Update(const Notification& notification,
139 Profile* profile) { 143 Profile* profile) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 return false; 204 return false;
201 } 205 }
202 206
203 void NotificationUIManagerAndroid::CancelAll() { 207 void NotificationUIManagerAndroid::CancelAll() {
204 NOTREACHED(); 208 NOTREACHED();
205 } 209 }
206 210
207 bool NotificationUIManagerAndroid::RegisterNotificationUIManager(JNIEnv* env) { 211 bool NotificationUIManagerAndroid::RegisterNotificationUIManager(JNIEnv* env) {
208 return RegisterNativesImpl(env); 212 return RegisterNativesImpl(env);
209 } 213 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698