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

Side by Side Diff: base/system_monitor/system_monitor_android.cc

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/system_monitor/system_monitor.h" 5 #include "base/system_monitor/system_monitor.h"
6 #include "jni/SystemMonitor_jni.h"
6 7
7 namespace base { 8 namespace base {
9 namespace android {
10
11 void OnBatteryChargingChanged(JNIEnv* env,
vandebo (ex-Chrome) 2012/10/04 17:55:56 This is nativeOnBatteryChargingChanged? A comment
bulach 2012/10/04 18:33:33 done, sorry about all the magic going in here. I c
12 jclass clazz,
13 jboolean is_charging) {
14 SystemMonitor::Get()->SetBatteryIsCharging(is_charging);
15 }
16
17 } // namespace android
8 18
9 bool SystemMonitor::IsBatteryPower() { 19 bool SystemMonitor::IsBatteryPower() {
10 NOTIMPLEMENTED(); 20 return is_battery_charging_;
11 return true; 21 }
22
23 void SystemMonitor::SetBatteryIsCharging(bool is_battery_charging) {
24 is_battery_charging_ = is_battery_charging;
25 SystemMonitor::Get()->ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT);
26 }
27
28 bool SystemMonitor::RegisterSystemMonitor(JNIEnv* env) {
29 return base::android::RegisterNativesImpl(env);
12 } 30 }
13 31
14 } // namespace base 32 } // namespace base
OLDNEW
« base/system_monitor/system_monitor.h ('K') | « base/system_monitor/system_monitor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698