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

Side by Side Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 258693012: Add BatteryStatusEventPump in Chromium for sending Battery status events Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 20 matching lines...) Expand all
31 #include "content/common/gpu/client/context_provider_command_buffer.h" 31 #include "content/common/gpu/client/context_provider_command_buffer.h"
32 #include "content/common/gpu/client/gpu_channel_host.h" 32 #include "content/common/gpu/client/gpu_channel_host.h"
33 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 33 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
34 #include "content/common/gpu/gpu_process_launch_causes.h" 34 #include "content/common/gpu/gpu_process_launch_causes.h"
35 #include "content/common/mime_registry_messages.h" 35 #include "content/common/mime_registry_messages.h"
36 #include "content/common/screen_orientation_messages.h" 36 #include "content/common/screen_orientation_messages.h"
37 #include "content/common/view_messages.h" 37 #include "content/common/view_messages.h"
38 #include "content/public/common/content_switches.h" 38 #include "content/public/common/content_switches.h"
39 #include "content/public/common/webplugininfo.h" 39 #include "content/public/common/webplugininfo.h"
40 #include "content/public/renderer/content_renderer_client.h" 40 #include "content/public/renderer/content_renderer_client.h"
41 #include "content/renderer/battery_status/battery_status_event_pump.h"
41 #include "content/renderer/device_sensors/device_motion_event_pump.h" 42 #include "content/renderer/device_sensors/device_motion_event_pump.h"
42 #include "content/renderer/device_sensors/device_orientation_event_pump.h" 43 #include "content/renderer/device_sensors/device_orientation_event_pump.h"
43 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" 44 #include "content/renderer/dom_storage/webstoragenamespace_impl.h"
44 #include "content/renderer/gamepad_shared_memory_reader.h" 45 #include "content/renderer/gamepad_shared_memory_reader.h"
45 #include "content/renderer/media/audio_decoder.h" 46 #include "content/renderer/media/audio_decoder.h"
46 #include "content/renderer/media/crypto/key_systems.h" 47 #include "content/renderer/media/crypto/key_systems.h"
47 #include "content/renderer/media/media_stream_dependency_factory.h" 48 #include "content/renderer/media/media_stream_dependency_factory.h"
48 #include "content/renderer/media/renderer_webaudiodevice_impl.h" 49 #include "content/renderer/media/renderer_webaudiodevice_impl.h"
49 #include "content/renderer/media/renderer_webmidiaccessor_impl.h" 50 #include "content/renderer/media/renderer_webmidiaccessor_impl.h"
50 #include "content/renderer/media/webcontentdecryptionmodule_impl.h" 51 #include "content/renderer/media/webcontentdecryptionmodule_impl.h"
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 // static 1159 // static
1159 void RendererWebKitPlatformSupportImpl::SetMockScreenOrientationForTesting( 1160 void RendererWebKitPlatformSupportImpl::SetMockScreenOrientationForTesting(
1160 blink::WebScreenOrientationType orientation) { 1161 blink::WebScreenOrientationType orientation) {
1161 if (!g_test_screen_orientation_listener) 1162 if (!g_test_screen_orientation_listener)
1162 return; 1163 return;
1163 g_test_screen_orientation_listener->didChangeScreenOrientation(orientation); 1164 g_test_screen_orientation_listener->didChangeScreenOrientation(orientation);
1164 } 1165 }
1165 1166
1166 //------------------------------------------------------------------------------ 1167 //------------------------------------------------------------------------------
1167 1168
1169 void RendererWebKitPlatformSupportImpl::setBatteryStatusListener(
1170 blink::WebBatteryStatusListener* listener) {
1171 if (!battery_status_event_pump_) {
1172 battery_status_event_pump_.reset(new BatteryStatusEventPump);
1173 battery_status_event_pump_->Attach(RenderThreadImpl::current());
1174 }
1175 battery_status_event_pump_->SetBatteryStatusListener(listener);
1176 }
1177
1178 //------------------------------------------------------------------------------
1179
1168 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota( 1180 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota(
1169 const blink::WebURL& storage_partition, 1181 const blink::WebURL& storage_partition,
1170 blink::WebStorageQuotaType type, 1182 blink::WebStorageQuotaType type,
1171 blink::WebStorageQuotaCallbacks callbacks) { 1183 blink::WebStorageQuotaCallbacks callbacks) {
1172 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) 1184 if (!thread_safe_sender_.get() || !quota_message_filter_.get())
1173 return; 1185 return;
1174 QuotaDispatcher::ThreadSpecificInstance( 1186 QuotaDispatcher::ThreadSpecificInstance(
1175 thread_safe_sender_.get(), 1187 thread_safe_sender_.get(),
1176 quota_message_filter_.get())->QueryStorageUsageAndQuota( 1188 quota_message_filter_.get())->QueryStorageUsageAndQuota(
1177 storage_partition, 1189 storage_partition,
1178 static_cast<quota::StorageType>(type), 1190 static_cast<quota::StorageType>(type),
1179 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); 1191 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
1180 } 1192 }
1181 1193
1182 } // namespace content 1194 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698