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_platform_bridge_android.h" | 5 #include "chrome/browser/notifications/notification_platform_bridge_android.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "content/public/common/platform_notification_data.h" | 28 #include "content/public/common/platform_notification_data.h" |
29 #include "jni/NotificationPlatformBridge_jni.h" | 29 #include "jni/NotificationPlatformBridge_jni.h" |
30 #include "third_party/skia/include/core/SkBitmap.h" | 30 #include "third_party/skia/include/core/SkBitmap.h" |
31 #include "ui/gfx/android/java_bitmap.h" | 31 #include "ui/gfx/android/java_bitmap.h" |
32 #include "ui/gfx/image/image.h" | 32 #include "ui/gfx/image/image.h" |
33 | 33 |
34 using base::android::AttachCurrentThread; | 34 using base::android::AttachCurrentThread; |
35 using base::android::ConvertJavaStringToUTF8; | 35 using base::android::ConvertJavaStringToUTF8; |
36 using base::android::ConvertUTF16ToJavaString; | 36 using base::android::ConvertUTF16ToJavaString; |
37 using base::android::ConvertUTF8ToJavaString; | 37 using base::android::ConvertUTF8ToJavaString; |
| 38 using base::android::JavaParamRef; |
| 39 using base::android::ScopedJavaLocalRef; |
38 | 40 |
39 namespace { | 41 namespace { |
40 | 42 |
41 ScopedJavaLocalRef<jobjectArray> ConvertToJavaBitmaps( | 43 ScopedJavaLocalRef<jobjectArray> ConvertToJavaBitmaps( |
42 const std::vector<message_center::ButtonInfo>& buttons) { | 44 const std::vector<message_center::ButtonInfo>& buttons) { |
43 std::vector<SkBitmap> skbitmaps; | 45 std::vector<SkBitmap> skbitmaps; |
44 for (const message_center::ButtonInfo& button : buttons) | 46 for (const message_center::ButtonInfo& button : buttons) |
45 skbitmaps.push_back(button.icon.AsBitmap()); | 47 skbitmaps.push_back(button.icon.AsBitmap()); |
46 | 48 |
47 JNIEnv* env = AttachCurrentThread(); | 49 JNIEnv* env = AttachCurrentThread(); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 RegeneratedNotificationInfo() {} | 305 RegeneratedNotificationInfo() {} |
304 | 306 |
305 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: | 307 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: |
306 RegeneratedNotificationInfo(const std::string& origin, | 308 RegeneratedNotificationInfo(const std::string& origin, |
307 const std::string& tag, | 309 const std::string& tag, |
308 const std::string& webapk_package) | 310 const std::string& webapk_package) |
309 : origin(origin), tag(tag), webapk_package(webapk_package) {} | 311 : origin(origin), tag(tag), webapk_package(webapk_package) {} |
310 | 312 |
311 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: | 313 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: |
312 ~RegeneratedNotificationInfo() {} | 314 ~RegeneratedNotificationInfo() {} |
OLD | NEW |