Chromium Code Reviews| Index: third_party/WebKit/Source/platform/battery/battery_dispatcher_proxy.h |
| diff --git a/content/renderer/battery_status/battery_status_dispatcher.h b/third_party/WebKit/Source/platform/battery/battery_dispatcher_proxy.h |
| similarity index 25% |
| rename from content/renderer/battery_status/battery_status_dispatcher.h |
| rename to third_party/WebKit/Source/platform/battery/battery_dispatcher_proxy.h |
| index f117a4b385e7ade0d39565f84bdb9bf6b9334a3c..2c8c8451428fd96b91eff888752367f7ce847b3a 100644 |
| --- a/content/renderer/battery_status/battery_status_dispatcher.h |
| +++ b/third_party/WebKit/Source/platform/battery/battery_dispatcher_proxy.h |
| @@ -2,37 +2,40 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ |
| -#define CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ |
| +#ifndef BLINK_PLATFORM_BATTERY_BATTERY_DISPATCHER_PROXY_H_ |
| +#define BLINK_PLATFORM_BATTERY_BATTERY_DISPATCHER_PROXY_H_ |
| -#include "base/compiler_specific.h" |
| -#include "base/macros.h" |
| -#include "content/common/content_export.h" |
| #include "device/battery/battery_monitor.mojom.h" |
| +#include "platform/PlatformExport.h" |
| +#include "wtf/Noncopyable.h" |
| namespace blink { |
| -class WebBatteryStatusListener; |
| -} |
| -namespace content { |
| +class BatteryStatusListener; |
| -class CONTENT_EXPORT BatteryStatusDispatcher { |
| +// This class connects a BatteryStatusListener to the underlying Mojo service. |
| +// Note that currently the access to the Mojo service is limited in platform/. |
| +// In future, we'll let classes in core/ and modules/ directly communicate with |
| +// Mojo, and then, there will be no need to use this proxy class. |
|
haraken
2016/02/15 13:18:39
// TODO(yukishiino): Remove this class.
Yuki
2016/02/16 07:31:58
Done.
|
| +class PLATFORM_EXPORT BatteryDispatcherProxy { |
| + WTF_MAKE_NONCOPYABLE(BatteryDispatcherProxy); |
| public: |
| - explicit BatteryStatusDispatcher(blink::WebBatteryStatusListener* listener); |
| - ~BatteryStatusDispatcher(); |
| + explicit BatteryDispatcherProxy(BatteryStatusListener*); |
| + ~BatteryDispatcherProxy(); |
| - private: |
| - friend class BatteryStatusDispatcherTest; |
| + void StartListening(); |
| + void StopListening(); |
| + private: |
| void QueryNextStatus(); |
| - void DidChange(device::BatteryStatusPtr battery_status); |
| + void OnDidChange(device::BatteryStatusPtr); |
| device::BatteryMonitorPtr monitor_; |
| - blink::WebBatteryStatusListener* listener_; |
| + BatteryStatusListener* listener_; |
| - DISALLOW_COPY_AND_ASSIGN(BatteryStatusDispatcher); |
| + friend class BatteryDispatcherProxyTest; |
| }; |
| -} // namespace content |
| +} // namespace blink |
| -#endif // CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ |
| +#endif // BLINK_PLATFORM_BATTERY_BATTERY_DISPATCHER_PROXY_H_ |