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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 #include "core/page/Page.h" 85 #include "core/page/Page.h"
86 #include "core/page/PagePopupClient.h" 86 #include "core/page/PagePopupClient.h"
87 #include "core/page/PointerLockController.h" 87 #include "core/page/PointerLockController.h"
88 #include "core/page/ScopedPageLoadDeferrer.h" 88 #include "core/page/ScopedPageLoadDeferrer.h"
89 #include "core/page/TouchDisambiguation.h" 89 #include "core/page/TouchDisambiguation.h"
90 #include "core/paint/PaintLayer.h" 90 #include "core/paint/PaintLayer.h"
91 #include "core/timing/DOMWindowPerformance.h" 91 #include "core/timing/DOMWindowPerformance.h"
92 #include "core/timing/Performance.h" 92 #include "core/timing/Performance.h"
93 #include "modules/accessibility/AXObject.h" 93 #include "modules/accessibility/AXObject.h"
94 #include "modules/accessibility/AXObjectCacheImpl.h" 94 #include "modules/accessibility/AXObjectCacheImpl.h"
95 #include "modules/battery/BatteryDispatcher.h"
95 #include "modules/credentialmanager/CredentialManagerClient.h" 96 #include "modules/credentialmanager/CredentialManagerClient.h"
96 #include "modules/encryptedmedia/MediaKeysController.h" 97 #include "modules/encryptedmedia/MediaKeysController.h"
97 #include "modules/storage/StorageNamespaceController.h" 98 #include "modules/storage/StorageNamespaceController.h"
98 #include "modules/webgl/WebGLRenderingContext.h" 99 #include "modules/webgl/WebGLRenderingContext.h"
99 #include "platform/ContextMenu.h" 100 #include "platform/ContextMenu.h"
100 #include "platform/ContextMenuItem.h" 101 #include "platform/ContextMenuItem.h"
101 #include "platform/Cursor.h" 102 #include "platform/Cursor.h"
102 #include "platform/KeyboardCodes.h" 103 #include "platform/KeyboardCodes.h"
103 #include "platform/Logging.h" 104 #include "platform/Logging.h"
104 #include "platform/NotImplemented.h" 105 #include "platform/NotImplemented.h"
(...skipping 4481 matching lines...) Expand 10 before | Expand all | Expand 10 after
4586 void WebViewImpl::forceNextWebGLContextCreationToFail() 4587 void WebViewImpl::forceNextWebGLContextCreationToFail()
4587 { 4588 {
4588 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); 4589 WebGLRenderingContext::forceNextWebGLContextCreationToFail();
4589 } 4590 }
4590 4591
4591 void WebViewImpl::forceNextDrawingBufferCreationToFail() 4592 void WebViewImpl::forceNextDrawingBufferCreationToFail()
4592 { 4593 {
4593 DrawingBuffer::forceNextDrawingBufferCreationToFail(); 4594 DrawingBuffer::forceNextDrawingBufferCreationToFail();
4594 } 4595 }
4595 4596
4597 void WebViewImpl::updateBatteryStatusForTesting(bool charging, double chargingTi me, double dischargingTime, double level)
4598 {
4599 BatteryDispatcher::instance().onUpdateBatteryStatus(
4600 BatteryStatus(charging, chargingTime, dischargingTime, level));
4601 }
4602
4603 void WebViewImpl::resetBatteryStatusForTesting()
4604 {
4605 BatteryDispatcher::instance().onUpdateBatteryStatus(BatteryStatus());
4606 }
4607
4596 void WebViewImpl::updatePageOverlays() 4608 void WebViewImpl::updatePageOverlays()
4597 { 4609 {
4598 if (m_pageColorOverlay) 4610 if (m_pageColorOverlay)
4599 m_pageColorOverlay->update(); 4611 m_pageColorOverlay->update();
4600 if (InspectorOverlay* overlay = inspectorOverlay()) { 4612 if (InspectorOverlay* overlay = inspectorOverlay()) {
4601 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); 4613 PageOverlay* inspectorPageOverlay = overlay->pageOverlay();
4602 if (inspectorPageOverlay) 4614 if (inspectorPageOverlay)
4603 inspectorPageOverlay->update(); 4615 inspectorPageOverlay->update();
4604 } 4616 }
4605 } 4617 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
4639 { 4651 {
4640 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4652 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4641 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4653 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4642 if (!page()) 4654 if (!page())
4643 return 1; 4655 return 1;
4644 4656
4645 return page()->deviceScaleFactor(); 4657 return page()->deviceScaleFactor();
4646 } 4658 }
4647 4659
4648 } // namespace blink 4660 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698