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

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

Issue 177793003: Chromium plumbing for Screen Orientation API lock/unlock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chromium_plumbing_screen_orientation
Patch Set: with tests Created 6 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 // 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 15 matching lines...) Expand all
26 #include "content/child/web_database_observer_impl.h" 26 #include "content/child/web_database_observer_impl.h"
27 #include "content/child/webblobregistry_impl.h" 27 #include "content/child/webblobregistry_impl.h"
28 #include "content/child/webfileutilities_impl.h" 28 #include "content/child/webfileutilities_impl.h"
29 #include "content/child/webmessageportchannel_impl.h" 29 #include "content/child/webmessageportchannel_impl.h"
30 #include "content/common/file_utilities_messages.h" 30 #include "content/common/file_utilities_messages.h"
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/view_messages.h" 37 #include "content/common/view_messages.h"
37 #include "content/public/common/content_switches.h" 38 #include "content/public/common/content_switches.h"
38 #include "content/public/common/webplugininfo.h" 39 #include "content/public/common/webplugininfo.h"
39 #include "content/public/renderer/content_renderer_client.h" 40 #include "content/public/renderer/content_renderer_client.h"
40 #include "content/renderer/device_orientation/device_motion_event_pump.h" 41 #include "content/renderer/device_orientation/device_motion_event_pump.h"
41 #include "content/renderer/device_orientation/device_orientation_event_pump.h" 42 #include "content/renderer/device_orientation/device_orientation_event_pump.h"
42 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" 43 #include "content/renderer/dom_storage/webstoragenamespace_impl.h"
43 #include "content/renderer/gamepad_shared_memory_reader.h" 44 #include "content/renderer/gamepad_shared_memory_reader.h"
44 #include "content/renderer/media/audio_decoder.h" 45 #include "content/renderer/media/audio_decoder.h"
45 #include "content/renderer/media/crypto/key_systems.h" 46 #include "content/renderer/media/crypto/key_systems.h"
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 void RendererWebKitPlatformSupportImpl::setScreenOrientationListener( 1075 void RendererWebKitPlatformSupportImpl::setScreenOrientationListener(
1075 blink::WebScreenOrientationListener* listener) { 1076 blink::WebScreenOrientationListener* listener) {
1076 if (!screen_orientation_dispatcher_) { 1077 if (!screen_orientation_dispatcher_) {
1077 screen_orientation_dispatcher_.reset( 1078 screen_orientation_dispatcher_.reset(
1078 new ScreenOrientationDispatcher(RenderThread::Get())); 1079 new ScreenOrientationDispatcher(RenderThread::Get()));
1079 } 1080 }
1080 1081
1081 screen_orientation_dispatcher_->setListener(listener); 1082 screen_orientation_dispatcher_->setListener(listener);
1082 } 1083 }
1083 1084
1085 void RendererWebKitPlatformSupportImpl::lockOrientation(
1086 blink::WebScreenOrientations orientations) {
1087 RenderThread::Get()->Send(new ScreenOrientationMsg_Lock(orientations));
1088 }
1089
1090 void RendererWebKitPlatformSupportImpl::unlockOrientation() {
1091 RenderThread::Get()->Send(new ScreenOrientationMsg_Unlock);
1092 }
1093
1084 //------------------------------------------------------------------------------ 1094 //------------------------------------------------------------------------------
1085 1095
1086 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota( 1096 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota(
1087 const blink::WebURL& storage_partition, 1097 const blink::WebURL& storage_partition,
1088 blink::WebStorageQuotaType type, 1098 blink::WebStorageQuotaType type,
1089 blink::WebStorageQuotaCallbacks callbacks) { 1099 blink::WebStorageQuotaCallbacks callbacks) {
1090 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) 1100 if (!thread_safe_sender_.get() || !quota_message_filter_.get())
1091 return; 1101 return;
1092 QuotaDispatcher::ThreadSpecificInstance( 1102 QuotaDispatcher::ThreadSpecificInstance(
1093 thread_safe_sender_.get(), 1103 thread_safe_sender_.get(),
1094 quota_message_filter_.get())->QueryStorageUsageAndQuota( 1104 quota_message_filter_.get())->QueryStorageUsageAndQuota(
1095 storage_partition, 1105 storage_partition,
1096 static_cast<quota::StorageType>(type), 1106 static_cast<quota::StorageType>(type),
1097 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); 1107 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
1098 } 1108 }
1099 1109
1100 } // namespace content 1110 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698