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

Unified Diff: base/power_monitor/power_monitor_android.cc

Issue 17074009: Created multi-process-friendly PowerMonitor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing windows unit test errors Created 7 years, 5 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
« no previous file with comments | « base/power_monitor/power_monitor_android.h ('k') | base/power_monitor/power_monitor_device_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/power_monitor/power_monitor_android.cc
diff --git a/base/power_monitor/power_monitor_android.cc b/base/power_monitor/power_monitor_android.cc
deleted file mode 100644
index 4900f6c7dcc0a9e42fc31a0ca8b24ff7de55a4a3..0000000000000000000000000000000000000000
--- a/base/power_monitor/power_monitor_android.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/power_monitor/power_monitor.h"
-#include "jni/PowerMonitor_jni.h"
-
-namespace base {
-
-// A helper function which is a friend of PowerMonitor.
-void ProcessPowerEventHelper(PowerMonitor::PowerEvent event) {
- if (base::PowerMonitor::Get())
- base::PowerMonitor::Get()->ProcessPowerEvent(event);
-}
-
-namespace android {
-
-// Native implementation of PowerMonitor.java.
-void OnBatteryChargingChanged(JNIEnv* env, jclass clazz) {
- ProcessPowerEventHelper(PowerMonitor::POWER_STATE_EVENT);
-}
-
-void OnMainActivityResumed(JNIEnv* env, jclass clazz) {
- ProcessPowerEventHelper(PowerMonitor::RESUME_EVENT);
-}
-
-void OnMainActivitySuspended(JNIEnv* env, jclass clazz) {
- ProcessPowerEventHelper(PowerMonitor::SUSPEND_EVENT);
-}
-
-} // namespace android
-
-bool PowerMonitor::IsBatteryPower() {
- JNIEnv* env = base::android::AttachCurrentThread();
- return base::android::Java_PowerMonitor_isBatteryPower(env);
-}
-
-bool RegisterPowerMonitor(JNIEnv* env) {
- return base::android::RegisterNativesImpl(env);
-}
-
-} // namespace base
« no previous file with comments | « base/power_monitor/power_monitor_android.h ('k') | base/power_monitor/power_monitor_device_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698