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

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

Issue 10735052: Adds temporary function lastOrientationNew (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
« no previous file with comments | « content/renderer/device_orientation_dispatcher.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/device_orientation_dispatcher.h" 5 #include "content/renderer/device_orientation_dispatcher.h"
6 6
7 #include "content/common/device_orientation_messages.h" 7 #include "content/common/device_orientation_messages.h"
8 #include "content/renderer/render_view_impl.h" 8 #include "content/renderer/render_view_impl.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientation. h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientation. h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientationC ontroller.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientationC ontroller.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void DeviceOrientationDispatcher::stopUpdating() { 44 void DeviceOrientationDispatcher::stopUpdating() {
45 Send(new DeviceOrientationHostMsg_StopUpdating(routing_id())); 45 Send(new DeviceOrientationHostMsg_StopUpdating(routing_id()));
46 started_ = false; 46 started_ = false;
47 } 47 }
48 48
49 WebKit::WebDeviceOrientation DeviceOrientationDispatcher::lastOrientation() 49 WebKit::WebDeviceOrientation DeviceOrientationDispatcher::lastOrientation()
50 const { 50 const {
51 return last_orientation_; 51 return last_orientation_;
52 } 52 }
53 53
54 WebKit::WebDeviceOrientation DeviceOrientationDispatcher::lastOrientationNew()
55 const {
56 return last_orientation_;
57 }
58
54 namespace { 59 namespace {
55 bool OrientationsEqual(const DeviceOrientationMsg_Updated_Params& a, 60 bool OrientationsEqual(const DeviceOrientationMsg_Updated_Params& a,
56 WebKit::WebDeviceOrientation* b) { 61 WebKit::WebDeviceOrientation* b) {
57 if (a.can_provide_alpha != b->canProvideAlpha()) 62 if (a.can_provide_alpha != b->canProvideAlpha())
58 return false; 63 return false;
59 if (a.can_provide_alpha && a.alpha != b->alpha()) 64 if (a.can_provide_alpha && a.alpha != b->alpha())
60 return false; 65 return false;
61 if (a.can_provide_beta != b->canProvideBeta()) 66 if (a.can_provide_beta != b->canProvideBeta())
62 return false; 67 return false;
63 if (a.can_provide_beta && a.beta != b->beta()) 68 if (a.can_provide_beta && a.beta != b->beta())
(...skipping 20 matching lines...) Expand all
84 if (p.can_provide_alpha) 89 if (p.can_provide_alpha)
85 last_orientation_.setAlpha(p.alpha); 90 last_orientation_.setAlpha(p.alpha);
86 if (p.can_provide_beta) 91 if (p.can_provide_beta)
87 last_orientation_.setBeta(p.beta); 92 last_orientation_.setBeta(p.beta);
88 if (p.can_provide_gamma) 93 if (p.can_provide_gamma)
89 last_orientation_.setGamma(p.gamma); 94 last_orientation_.setGamma(p.gamma);
90 if (p.can_provide_absolute) 95 if (p.can_provide_absolute)
91 last_orientation_.setAbsolute(p.absolute); 96 last_orientation_.setAbsolute(p.absolute);
92 controller_->didChangeDeviceOrientation(last_orientation_); 97 controller_->didChangeDeviceOrientation(last_orientation_);
93 } 98 }
OLDNEW
« no previous file with comments | « content/renderer/device_orientation_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698