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

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

Issue 10827415: Chromium-side implementation of DeviceMotion. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test should set the kEnableDeviceMotion flag Created 8 years, 4 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 | Annotate | Revision Log
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/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/linux/WebSan dboxSupport.h" 75 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/linux/WebSan dboxSupport.h"
76 #endif 76 #endif
77 77
78 #if defined(OS_POSIX) 78 #if defined(OS_POSIX)
79 #include "base/file_descriptor_posix.h" 79 #include "base/file_descriptor_posix.h"
80 #endif 80 #endif
81 81
82 using content::RenderThread; 82 using content::RenderThread;
83 using WebKit::WebAudioDevice; 83 using WebKit::WebAudioDevice;
84 using WebKit::WebBlobRegistry; 84 using WebKit::WebBlobRegistry;
85 using WebKit::WebDeviceMotionDetector;
85 using WebKit::WebFileInfo; 86 using WebKit::WebFileInfo;
86 using WebKit::WebFileSystem; 87 using WebKit::WebFileSystem;
87 using WebKit::WebFrame; 88 using WebKit::WebFrame;
88 using WebKit::WebGamepads; 89 using WebKit::WebGamepads;
89 using WebKit::WebIDBFactory; 90 using WebKit::WebIDBFactory;
90 using WebKit::WebIDBKey; 91 using WebKit::WebIDBKey;
91 using WebKit::WebIDBKeyPath; 92 using WebKit::WebIDBKeyPath;
92 using WebKit::WebKitPlatformSupport; 93 using WebKit::WebKitPlatformSupport;
93 using WebKit::WebMediaStreamCenter; 94 using WebKit::WebMediaStreamCenter;
94 using WebKit::WebMediaStreamCenterClient; 95 using WebKit::WebMediaStreamCenterClient;
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 long long RendererWebKitPlatformSupportImpl::databaseGetFileSize( 555 long long RendererWebKitPlatformSupportImpl::databaseGetFileSize(
555 const WebString& vfs_file_name) { 556 const WebString& vfs_file_name) {
556 return DatabaseUtil::DatabaseGetFileSize(vfs_file_name); 557 return DatabaseUtil::DatabaseGetFileSize(vfs_file_name);
557 } 558 }
558 559
559 long long RendererWebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin( 560 long long RendererWebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin(
560 const WebString& origin_identifier) { 561 const WebString& origin_identifier) {
561 return DatabaseUtil::DatabaseGetSpaceAvailable(origin_identifier); 562 return DatabaseUtil::DatabaseGetSpaceAvailable(origin_identifier);
562 } 563 }
563 564
565 //------------------------------------------------------------------------------
566
567 WebDeviceMotionDetector*
568 RendererWebKitPlatformSupportImpl::deviceMotionDetector() {
569 WebFrame* web_frame = WebFrame::frameForCurrentContext();
570 if (!web_frame)
571 return NULL;
572 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view());
573 if (!render_view)
574 return NULL;
575 return render_view->GetDeviceMotionDispatcher();
576 }
577
578 //------------------------------------------------------------------------------
579
564 WebKit::WebSharedWorkerRepository* 580 WebKit::WebSharedWorkerRepository*
565 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { 581 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() {
566 if (!CommandLine::ForCurrentProcess()->HasSwitch( 582 if (!CommandLine::ForCurrentProcess()->HasSwitch(
567 switches::kDisableSharedWorkers)) { 583 switches::kDisableSharedWorkers)) {
568 return shared_worker_repository_.get(); 584 return shared_worker_repository_.get();
569 } else { 585 } else {
570 return NULL; 586 return NULL;
571 } 587 }
572 } 588 }
573 589
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 bool enable) { 746 bool enable) {
731 bool was_enabled = g_sandbox_enabled; 747 bool was_enabled = g_sandbox_enabled;
732 g_sandbox_enabled = enable; 748 g_sandbox_enabled = enable;
733 return was_enabled; 749 return was_enabled;
734 } 750 }
735 751
736 GpuChannelHostFactory* 752 GpuChannelHostFactory*
737 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { 753 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() {
738 return RenderThreadImpl::current(); 754 return RenderThreadImpl::current();
739 } 755 }
OLDNEW
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | content/test/data/device_orientation/device_motion_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698