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

Unified Diff: base/system_monitor/system_monitor.h

Issue 11027024: Android: Integrates native and java SystemMonitor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: base/system_monitor/system_monitor.h
diff --git a/base/system_monitor/system_monitor.h b/base/system_monitor/system_monitor.h
index ea95da89ccbe9fb6635b8ae905b6415ac977ca24..5fb06ece1ed8f52ad9ec7d115e4014852834b520 100644
--- a/base/system_monitor/system_monitor.h
+++ b/base/system_monitor/system_monitor.h
@@ -38,6 +38,10 @@
#include <objc/runtime.h>
#endif // OS_IOS
+#if defined(OS_ANDROID)
+#include <jni.h>
vandebo (ex-Chrome) 2012/10/04 17:55:56 Can you declare instead of include?
bulach 2012/10/04 18:33:33 unfortunately not.. :( there are some nasty typede
+#endif
+
namespace base {
// Class for monitoring various system-related subsystems
@@ -95,6 +99,11 @@ class BASE_EXPORT SystemMonitor {
#endif // OS_IOS
#endif // OS_MACOSX
+#if defined(OS_ANDROID)
+ static bool RegisterSystemMonitor(JNIEnv* env);
vandebo (ex-Chrome) 2012/10/04 17:55:56 I'm not familiar with how JNI is being used in Chr
bulach 2012/10/04 18:33:33 there's never a silly question, just poorly docume
vandebo (ex-Chrome) 2012/10/04 19:19:22 If it doesn't need to be a member of the class, th
+ void SetBatteryIsCharging(bool is_battery_charging);
+#endif
+
// Returns information for attached removable storage.
std::vector<RemovableStorageInfo> GetAttachedRemovableStorage() const;
@@ -224,6 +233,11 @@ class BASE_EXPORT SystemMonitor {
std::vector<id> notification_observers_;
#endif
+#if defined(OS_ANDROID)
+ // Holds the battery state from the java side.
+ bool is_battery_charging_;
Satish 2012/10/04 14:31:45 Good idea. This could also be used on windows so b
vandebo (ex-Chrome) 2012/10/04 17:55:56 But adding SetBatteryIsCharging exposes more of th
bulach 2012/10/04 18:33:33 this was all to avoid one extra JNI hop.. since th
+#endif
+
// For manipulating removable_storage_map_ structure.
mutable base::Lock removable_storage_lock_;
// Map of all the attached removable storage devices.

Powered by Google App Engine
This is Rietveld 408576698