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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1538803002: Migrates battery_status from content/renderer/ to WebKit/platform/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BatteryStatusDispatcher => BatteryDispatcherProxy Created 4 years, 10 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/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 59b9e3ec9b35cabddbc138f27a570afff5acedcc..22bf93533ce670b5fc859996e6546e4fe78e287d 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -92,6 +92,7 @@
#include "core/timing/Performance.h"
#include "modules/accessibility/AXObject.h"
#include "modules/accessibility/AXObjectCacheImpl.h"
+#include "modules/battery/BatteryDispatcher.h"
#include "modules/credentialmanager/CredentialManagerClient.h"
#include "modules/encryptedmedia/MediaKeysController.h"
#include "modules/storage/StorageNamespaceController.h"
@@ -4521,6 +4522,17 @@ void WebViewImpl::forceNextDrawingBufferCreationToFail()
DrawingBuffer::forceNextDrawingBufferCreationToFail();
}
+void WebViewImpl::updateBatteryStatusForTesting(bool charging, double chargingTime, double dischargingTime, double level)
+{
+ BatteryDispatcher::instance().OnUpdateBatteryStatus(
+ BatteryStatus(charging, chargingTime, dischargingTime, level));
+}
+
+void WebViewImpl::resetBatteryStatusForTesting()
+{
+ BatteryDispatcher::instance().OnUpdateBatteryStatus(BatteryStatus());
+}
+
void WebViewImpl::updatePageOverlays()
{
if (m_pageColorOverlay)

Powered by Google App Engine
This is Rietveld 408576698