| 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" |
| 11 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/strings/string_number_conversions.h" | |
| 16 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/notifications/native_notification_display_service.h" | 16 #include "chrome/browser/notifications/native_notification_display_service.h" |
| 18 #include "chrome/browser/notifications/notification.h" | 17 #include "chrome/browser/notifications/notification.h" |
| 19 #include "chrome/browser/notifications/notification_common.h" | 18 #include "chrome/browser/notifications/notification_common.h" |
| 20 #include "chrome/browser/notifications/notification_display_service_factory.h" | 19 #include "chrome/browser/notifications/notification_display_service_factory.h" |
| 21 #include "chrome/browser/notifications/persistent_notification_delegate.h" | 20 #include "chrome/browser/notifications/persistent_notification_delegate.h" |
| 22 #include "chrome/browser/notifications/platform_notification_service_impl.h" | 21 #include "chrome/browser/notifications/platform_notification_service_impl.h" |
| 23 #include "chrome/browser/profiles/profile_manager.h" | 22 #include "chrome/browser/profiles/profile_manager.h" |
| 24 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
| 25 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 276 } |
| 278 | 277 |
| 279 bool NotificationPlatformBridgeAndroid::GetDisplayed( | 278 bool NotificationPlatformBridgeAndroid::GetDisplayed( |
| 280 const std::string& profile_id, | 279 const std::string& profile_id, |
| 281 bool incognito, | 280 bool incognito, |
| 282 std::set<std::string>* notifications) const { | 281 std::set<std::string>* notifications) const { |
| 283 // TODO(miguelg): This can actually be implemented for M+ | 282 // TODO(miguelg): This can actually be implemented for M+ |
| 284 return false; | 283 return false; |
| 285 } | 284 } |
| 286 | 285 |
| 287 bool NotificationPlatformBridgeAndroid::SupportsNotificationCenter() const { | |
| 288 return true; | |
| 289 } | |
| 290 | |
| 291 // static | 286 // static |
| 292 bool NotificationPlatformBridgeAndroid::RegisterNotificationPlatformBridge( | 287 bool NotificationPlatformBridgeAndroid::RegisterNotificationPlatformBridge( |
| 293 JNIEnv* env) { | 288 JNIEnv* env) { |
| 294 return RegisterNativesImpl(env); | 289 return RegisterNativesImpl(env); |
| 295 } | 290 } |
| 296 | 291 |
| 297 // static | 292 // static |
| 298 void NotificationPlatformBridgeAndroid::RegisterProfilePrefs( | 293 void NotificationPlatformBridgeAndroid::RegisterProfilePrefs( |
| 299 user_prefs::PrefRegistrySyncable* registry) { | 294 user_prefs::PrefRegistrySyncable* registry) { |
| 300 registry->RegisterBooleanPref(prefs::kNotificationsVibrateEnabled, true); | 295 registry->RegisterBooleanPref(prefs::kNotificationsVibrateEnabled, true); |
| 301 } | 296 } |
| 302 | 297 |
| 303 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: | 298 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: |
| 304 RegeneratedNotificationInfo() {} | 299 RegeneratedNotificationInfo() {} |
| 305 | 300 |
| 306 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: | 301 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: |
| 307 RegeneratedNotificationInfo(const std::string& origin, | 302 RegeneratedNotificationInfo(const std::string& origin, |
| 308 const std::string& tag, | 303 const std::string& tag, |
| 309 const std::string& webapk_package) | 304 const std::string& webapk_package) |
| 310 : origin(origin), tag(tag), webapk_package(webapk_package) {} | 305 : origin(origin), tag(tag), webapk_package(webapk_package) {} |
| 311 | 306 |
| 312 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: | 307 NotificationPlatformBridgeAndroid::RegeneratedNotificationInfo:: |
| 313 ~RegeneratedNotificationInfo() {} | 308 ~RegeneratedNotificationInfo() {} |
| OLD | NEW |