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

Unified Diff: third_party/WebKit/Source/modules/battery/BatteryDispatcher.h

Issue 1835873002: Removes BatteryDispatcherProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes export settings again. Created 4 years, 9 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: third_party/WebKit/Source/modules/battery/BatteryDispatcher.h
diff --git a/third_party/WebKit/Source/modules/battery/BatteryDispatcher.h b/third_party/WebKit/Source/modules/battery/BatteryDispatcher.h
index cd99dec25f8a7572ce8d71cca15625687b18ed99..69179895ac3d6d0ab814b89dbb678a6d77505906 100644
--- a/third_party/WebKit/Source/modules/battery/BatteryDispatcher.h
+++ b/third_party/WebKit/Source/modules/battery/BatteryDispatcher.h
@@ -6,37 +6,44 @@
#define BatteryDispatcher_h
#include "core/frame/PlatformEventDispatcher.h"
+#include "device/battery/battery_monitor.mojom.h"
#include "modules/ModulesExport.h"
#include "modules/battery/BatteryManager.h"
-#include "platform/battery/battery_dispatcher_proxy.h"
+#include "modules/battery/battery_status.h"
#include "wtf/OwnPtr.h"
namespace blink {
-class MODULES_EXPORT BatteryDispatcher final : public GarbageCollectedFinalized<BatteryDispatcher>, public PlatformEventDispatcher, public BatteryDispatcherProxy::Listener {
+class MODULES_EXPORT BatteryDispatcher final : public GarbageCollectedFinalized<BatteryDispatcher>, public PlatformEventDispatcher {
USING_GARBAGE_COLLECTED_MIXIN(BatteryDispatcher);
+ WTF_MAKE_NONCOPYABLE(BatteryDispatcher);
public:
static BatteryDispatcher& instance();
- ~BatteryDispatcher() override;
const BatteryStatus* latestData() const
{
return m_hasLatestData ? &m_batteryStatus : nullptr;
}
- // Inherited from BatteryDispatcherProxy::Listener.
- void OnUpdateBatteryStatus(const BatteryStatus&) override;
+ void updateBatteryStatusForTesting(const BatteryStatus& batteryStatus)
+ {
+ updateBatteryStatus(batteryStatus);
+ }
private:
BatteryDispatcher();
+ void queryNextStatus();
+ void onDidChange(device::BatteryStatusPtr);
+ void updateBatteryStatus(const BatteryStatus&);
+
// Inherited from PlatformEventDispatcher.
void startListening() override;
void stopListening() override;
+ device::BatteryMonitorPtr m_monitor;
BatteryStatus m_batteryStatus;
bool m_hasLatestData;
- OwnPtr<BatteryDispatcherProxy> m_batteryDispatcherProxy;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/BUILD.gn ('k') | third_party/WebKit/Source/modules/battery/BatteryDispatcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698