OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/device_orientation_dispatcher.h" | 5 #include "chrome/renderer/device_orientation_dispatcher.h" |
6 | 6 |
| 7 #include "chrome/common/render_messages_params.h" |
7 #include "chrome/renderer/render_view.h" | 8 #include "chrome/renderer/render_view.h" |
8 #include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientation.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientation.h" |
9 #include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientationControll
er.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientationControll
er.h" |
10 | 11 |
11 DeviceOrientationDispatcher::DeviceOrientationDispatcher( | 12 DeviceOrientationDispatcher::DeviceOrientationDispatcher( |
12 RenderView* render_view) | 13 RenderView* render_view) |
13 : render_view_(render_view), | 14 : render_view_(render_view), |
14 controller_(NULL), | 15 controller_(NULL), |
15 started_(false) { | 16 started_(false) { |
16 } | 17 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 void DeviceOrientationDispatcher::OnDeviceOrientationUpdated( | 64 void DeviceOrientationDispatcher::OnDeviceOrientationUpdated( |
64 const ViewMsg_DeviceOrientationUpdated_Params& p) { | 65 const ViewMsg_DeviceOrientationUpdated_Params& p) { |
65 last_update_.reset(new ViewMsg_DeviceOrientationUpdated_Params(p)); | 66 last_update_.reset(new ViewMsg_DeviceOrientationUpdated_Params(p)); |
66 | 67 |
67 WebKit::WebDeviceOrientation orientation(p.can_provide_alpha, p.alpha, | 68 WebKit::WebDeviceOrientation orientation(p.can_provide_alpha, p.alpha, |
68 p.can_provide_beta, p.beta, | 69 p.can_provide_beta, p.beta, |
69 p.can_provide_gamma, p.gamma); | 70 p.can_provide_gamma, p.gamma); |
70 | 71 |
71 controller_->didChangeDeviceOrientation(orientation); | 72 controller_->didChangeDeviceOrientation(orientation); |
72 } | 73 } |
OLD | NEW |