| 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 const std::string& profile_id, | 316 const std::string& profile_id, |
| 317 bool incognito, | 317 bool incognito, |
| 318 const GetDisplayedNotificationsCallback& callback) const { | 318 const GetDisplayedNotificationsCallback& callback) const { |
| 319 auto displayed_notifications = base::MakeUnique<std::set<std::string>>(); | 319 auto displayed_notifications = base::MakeUnique<std::set<std::string>>(); |
| 320 content::BrowserThread::PostTask( | 320 content::BrowserThread::PostTask( |
| 321 content::BrowserThread::UI, FROM_HERE, | 321 content::BrowserThread::UI, FROM_HERE, |
| 322 base::Bind(callback, base::Passed(&displayed_notifications), | 322 base::Bind(callback, base::Passed(&displayed_notifications), |
| 323 false /* supports_synchronization */)); | 323 false /* supports_synchronization */)); |
| 324 } | 324 } |
| 325 | 325 |
| 326 void NotificationPlatformBridgeAndroid::SetReadyCallback( |
| 327 NotificationBridgeReadyCallback callback) { |
| 328 std::move(callback).Run(true); |
| 329 } |
| 330 |
| 326 // static | 331 // static |
| 327 bool NotificationPlatformBridgeAndroid::RegisterNotificationPlatformBridge( | 332 bool NotificationPlatformBridgeAndroid::RegisterNotificationPlatformBridge( |
| 328 JNIEnv* env) { | 333 JNIEnv* env) { |
| 329 return RegisterNativesImpl(env); | 334 return RegisterNativesImpl(env); |
| 330 } | 335 } |
| 331 | 336 |
| 332 // static | 337 // static |
| 333 void NotificationPlatformBridgeAndroid::RegisterProfilePrefs( | 338 void NotificationPlatformBridgeAndroid::RegisterProfilePrefs( |
| 334 user_prefs::PrefRegistrySyncable* registry) { | 339 user_prefs::PrefRegistrySyncable* registry) { |
| 335 registry->RegisterBooleanPref(prefs::kNotificationsVibrateEnabled, true); | 340 registry->RegisterBooleanPref(prefs::kNotificationsVibrateEnabled, true); |
| 336 } | 341 } |
| 337 | 342 |
| 338 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: | 343 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: |
| 339 RegeneratedNotificationInfo() {} | 344 RegeneratedNotificationInfo() {} |
| 340 | 345 |
| 341 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: | 346 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: |
| 342 RegeneratedNotificationInfo(const std::string& origin, | 347 RegeneratedNotificationInfo(const std::string& origin, |
| 343 const std::string& tag, | 348 const std::string& tag, |
| 344 const std::string& webapk_package) | 349 const std::string& webapk_package) |
| 345 : origin(origin), tag(tag), webapk_package(webapk_package) {} | 350 : origin(origin), tag(tag), webapk_package(webapk_package) {} |
| 346 | 351 |
| 347 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: | 352 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: |
| 348 ~RegeneratedNotificationInfo() {} | 353 ~RegeneratedNotificationInfo() {} |
| OLD | NEW |