| Index: content/browser/battery_status/battery_status_provider_impl.cc
|
| diff --git a/content/browser/battery_status/battery_status_provider_impl.cc b/content/browser/battery_status/battery_status_provider_impl.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2a9cbef144a3bcc6ed15625343231b6c99ee5a7f
|
| --- /dev/null
|
| +++ b/content/browser/battery_status/battery_status_provider_impl.cc
|
| @@ -0,0 +1,44 @@
|
| +// Copyright (c) 2012 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 "content/browser/battery_status/battery_status_provider_impl.h"
|
| +
|
| +#include "content/public/browser/browser_thread.h"
|
| +#include "content/public/browser/power_supply_status.h"
|
| +
|
| +namespace content {
|
| +
|
| +BatteryStatusProvider* BatteryStatusProvider::GetInstance() {
|
| + return BatteryStatusProviderImpl::GetInstance();
|
| +}
|
| +
|
| +BatteryStatusProviderImpl* BatteryStatusProviderImpl::GetInstance() {
|
| + return Singleton<BatteryStatusProviderImpl>::get();
|
| +}
|
| +
|
| +void BatteryStatusProviderImpl::AddObserver(
|
| + BatteryStatusProviderImpl::Observer* obs) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| + observers_.AddObserver(obs);
|
| +}
|
| +
|
| +void BatteryStatusProviderImpl::RemoveObserver(
|
| + BatteryStatusProviderImpl::Observer* obs) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| + observers_.RemoveObserver(obs);
|
| +}
|
| +
|
| +void BatteryStatusProviderImpl::SendUpdate(
|
| + const PowerSupplyStatus& status) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| + FOR_EACH_OBSERVER(Observer, observers_, PowerChanged(status));
|
| +}
|
| +
|
| +BatteryStatusProviderImpl::BatteryStatusProviderImpl() {
|
| +}
|
| +
|
| +BatteryStatusProviderImpl::~BatteryStatusProviderImpl() {
|
| +}
|
| +
|
| +} // namespace content
|
|
|