Chromium Code Reviews| 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 312 } | 312 } |
| 313 | 313 |
| 314 bool NotificationPlatformBridgeAndroid::GetDisplayed( | 314 bool NotificationPlatformBridgeAndroid::GetDisplayed( |
| 315 const std::string& profile_id, | 315 const std::string& profile_id, |
| 316 bool incognito, | 316 bool incognito, |
| 317 std::set<std::string>* notifications) const { | 317 std::set<std::string>* notifications) const { |
| 318 // TODO(miguelg): This can actually be implemented for M+ | 318 // TODO(miguelg): This can actually be implemented for M+ |
| 319 return false; | 319 return false; |
| 320 } | 320 } |
| 321 | 321 |
| 322 void NotificationPlatformBridgeMac::GetDisplayedAsync( | |
| 323 const std::string& profile_id, | |
| 324 bool incognito, | |
| 325 const NotificationCommon::NotificationResultCallback& callback) const { | |
| 326 std::unique_ptr<std::set<std::string>> displayedNotifications = | |
| 327 base::MakeUnique<std::set<std::string>>(); | |
| 328 content::BrowserThread::PostTask( | |
| 329 content::BrowserThread::IO, FROM_HERE, | |
| 330 base::Bind(callback, base::Passed(&displayedNotifications), | |
| 331 false /* supports sync */)); | |
|
Peter Beverloo
2017/02/24 16:12:24
nit: "sync" is rather ambiguous (also in the other
Miguel Garcia
2017/03/22 22:00:07
Done.
| |
| 332 } | |
| 333 | |
| 322 // static | 334 // static |
| 323 bool NotificationPlatformBridgeAndroid::RegisterNotificationPlatformBridge( | 335 bool NotificationPlatformBridgeAndroid::RegisterNotificationPlatformBridge( |
| 324 JNIEnv* env) { | 336 JNIEnv* env) { |
| 325 return RegisterNativesImpl(env); | 337 return RegisterNativesImpl(env); |
| 326 } | 338 } |
| 327 | 339 |
| 328 // static | 340 // static |
| 329 void NotificationPlatformBridgeAndroid::RegisterProfilePrefs( | 341 void NotificationPlatformBridgeAndroid::RegisterProfilePrefs( |
| 330 user_prefs::PrefRegistrySyncable* registry) { | 342 user_prefs::PrefRegistrySyncable* registry) { |
| 331 registry->RegisterBooleanPref(prefs::kNotificationsVibrateEnabled, true); | 343 registry->RegisterBooleanPref(prefs::kNotificationsVibrateEnabled, true); |
| 332 } | 344 } |
| 333 | 345 |
| 334 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: | 346 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: |
| 335 RegeneratedNotificationInfo() {} | 347 RegeneratedNotificationInfo() {} |
| 336 | 348 |
| 337 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: | 349 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: |
| 338 RegeneratedNotificationInfo(const std::string& origin, | 350 RegeneratedNotificationInfo(const std::string& origin, |
| 339 const std::string& tag, | 351 const std::string& tag, |
| 340 const std::string& webapk_package) | 352 const std::string& webapk_package) |
| 341 : origin(origin), tag(tag), webapk_package(webapk_package) {} | 353 : origin(origin), tag(tag), webapk_package(webapk_package) {} |
| 342 | 354 |
| 343 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: | 355 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: |
| 344 ~RegeneratedNotificationInfo() {} | 356 ~RegeneratedNotificationInfo() {} |
| OLD | NEW |