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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2078433002: [sensors] Introduce Generic Sensor API interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cap frequency to 60Hz. Created 4 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #include "content/public/browser/stream_handle.h" 73 #include "content/public/browser/stream_handle.h"
74 #include "content/public/browser/user_metrics.h" 74 #include "content/public/browser/user_metrics.h"
75 #include "content/public/common/browser_side_navigation_policy.h" 75 #include "content/public/common/browser_side_navigation_policy.h"
76 #include "content/public/common/content_constants.h" 76 #include "content/public/common/content_constants.h"
77 #include "content/public/common/content_switches.h" 77 #include "content/public/common/content_switches.h"
78 #include "content/public/common/file_chooser_file_info.h" 78 #include "content/public/common/file_chooser_file_info.h"
79 #include "content/public/common/file_chooser_params.h" 79 #include "content/public/common/file_chooser_params.h"
80 #include "content/public/common/isolated_world_ids.h" 80 #include "content/public/common/isolated_world_ids.h"
81 #include "content/public/common/url_constants.h" 81 #include "content/public/common/url_constants.h"
82 #include "content/public/common/url_utils.h" 82 #include "content/public/common/url_utils.h"
83 #include "device/sensors/sensor_service.h"
83 #include "device/vibration/vibration_manager_impl.h" 84 #include "device/vibration/vibration_manager_impl.h"
84 #include "services/shell/public/cpp/interface_provider.h" 85 #include "services/shell/public/cpp/interface_provider.h"
85 #include "ui/accessibility/ax_tree.h" 86 #include "ui/accessibility/ax_tree.h"
86 #include "ui/accessibility/ax_tree_update.h" 87 #include "ui/accessibility/ax_tree_update.h"
87 #include "ui/gfx/geometry/quad_f.h" 88 #include "ui/gfx/geometry/quad_f.h"
88 #include "url/gurl.h" 89 #include "url/gurl.h"
89 90
90 #if defined(OS_ANDROID) 91 #if defined(OS_ANDROID)
91 #include "content/browser/mojo/service_registrar_android.h" 92 #include "content/browser/mojo/service_registrar_android.h"
92 #endif 93 #endif
(...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 2066
2066 #if defined(ENABLE_WEBVR) 2067 #if defined(ENABLE_WEBVR)
2067 const base::CommandLine& browser_command_line = 2068 const base::CommandLine& browser_command_line =
2068 *base::CommandLine::ForCurrentProcess(); 2069 *base::CommandLine::ForCurrentProcess();
2069 2070
2070 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { 2071 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) {
2071 GetInterfaceRegistry()->AddInterface<device::VRService>( 2072 GetInterfaceRegistry()->AddInterface<device::VRService>(
2072 base::Bind(&device::VRDeviceManager::BindRequest)); 2073 base::Bind(&device::VRDeviceManager::BindRequest));
2073 } 2074 }
2074 #endif 2075 #endif
2076 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
2077 switches::kEnableGenericSensors)) {
2078 GetInterfaceRegistry()->AddInterface(base::Bind(
2079 &device::SensorService::BindRequest,
2080 base::RetainedRef(
2081 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))));
2082 }
2075 2083
2076 GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces( 2084 GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces(
2077 GetInterfaceRegistry(), this); 2085 GetInterfaceRegistry(), this);
2078 } 2086 }
2079 2087
2080 void RenderFrameHostImpl::ResetWaitingState() { 2088 void RenderFrameHostImpl::ResetWaitingState() {
2081 DCHECK(is_active()); 2089 DCHECK(is_active());
2082 2090
2083 // The active state of the RVH is determined by its main frame, since 2091 // The active state of the RVH is determined by its main frame, since
2084 // subframes should have their own widgets. 2092 // subframes should have their own widgets.
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
2958 // handler after it's destroyed so it can't run after the RFHI is destroyed. 2966 // handler after it's destroyed so it can't run after the RFHI is destroyed.
2959 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 2967 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
2960 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 2968 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
2961 } 2969 }
2962 2970
2963 void RenderFrameHostImpl::DeleteWebBluetoothService() { 2971 void RenderFrameHostImpl::DeleteWebBluetoothService() {
2964 web_bluetooth_service_.reset(); 2972 web_bluetooth_service_.reset();
2965 } 2973 }
2966 2974
2967 } // namespace content 2975 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698