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

Side by Side Diff: third_party/WebKit/Source/modules/device_orientation/DeviceOrientationDispatcher.cpp

Issue 2885203004: Refactor content/renderer/device_sensors to use device/generic_sensor instead of device/sensors (Closed)
Patch Set: updated content/renderer/BUILD.gn Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 void DeviceOrientationDispatcher::StartListening() { 63 void DeviceOrientationDispatcher::StartListening() {
64 Platform::Current()->StartListening(GetWebPlatformEventType(), this); 64 Platform::Current()->StartListening(GetWebPlatformEventType(), this);
65 } 65 }
66 66
67 void DeviceOrientationDispatcher::StopListening() { 67 void DeviceOrientationDispatcher::StopListening() {
68 Platform::Current()->StopListening(GetWebPlatformEventType()); 68 Platform::Current()->StopListening(GetWebPlatformEventType());
69 last_device_orientation_data_.Clear(); 69 last_device_orientation_data_.Clear();
70 } 70 }
71 71
72 void DeviceOrientationDispatcher::DidChangeDeviceOrientation( 72 void DeviceOrientationDispatcher::DidChangeDeviceOrientation(
73 const device::OrientationData& motion) { 73 const WebDeviceOrientationData& motion) {
74 last_device_orientation_data_ = DeviceOrientationData::Create(motion); 74 last_device_orientation_data_ = DeviceOrientationData::Create(motion);
75 NotifyControllers(); 75 NotifyControllers();
76 } 76 }
77 77
78 DeviceOrientationData* 78 DeviceOrientationData*
79 DeviceOrientationDispatcher::LatestDeviceOrientationData() { 79 DeviceOrientationDispatcher::LatestDeviceOrientationData() {
80 return last_device_orientation_data_.Get(); 80 return last_device_orientation_data_.Get();
81 } 81 }
82 82
83 WebPlatformEventType DeviceOrientationDispatcher::GetWebPlatformEventType() 83 WebPlatformEventType DeviceOrientationDispatcher::GetWebPlatformEventType()
84 const { 84 const {
85 return (absolute_) ? kWebPlatformEventTypeDeviceOrientationAbsolute 85 return (absolute_) ? kWebPlatformEventTypeDeviceOrientationAbsolute
86 : kWebPlatformEventTypeDeviceOrientation; 86 : kWebPlatformEventTypeDeviceOrientation;
87 } 87 }
88 88
89 } // namespace blink 89 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698