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

Side by Side Diff: Source/modules/device_orientation/DeviceOrientationEvent.cpp

Issue 1186823014: [bindings] Eliminate custom bindings for DeviceOrientationEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Initialize the constructor to be null Created 5 years, 6 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 2010, The Android Open Source Project 2 * Copyright 2010, The Android Open Source Project
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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 27 matching lines...) Expand all
38 : m_orientation(DeviceOrientationData::create()) 38 : m_orientation(DeviceOrientationData::create())
39 { 39 {
40 } 40 }
41 41
42 DeviceOrientationEvent::DeviceOrientationEvent(const AtomicString& eventType, De viceOrientationData* orientation) 42 DeviceOrientationEvent::DeviceOrientationEvent(const AtomicString& eventType, De viceOrientationData* orientation)
43 : Event(eventType, false, false) // Can't bubble, not cancelable 43 : Event(eventType, false, false) // Can't bubble, not cancelable
44 , m_orientation(orientation) 44 , m_orientation(orientation)
45 { 45 {
46 } 46 }
47 47
48 void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type , bool bubbles, bool cancelable, DeviceOrientationData* orientation) 48 void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type , bool bubbles, bool cancelable, const Nullable<double>& alpha, const Nullable<d ouble>& beta, const Nullable<double>& gamma, const Nullable<bool>& absolute)
49 { 49 {
50 if (dispatched()) 50 if (dispatched())
51 return; 51 return;
52 52
53 initEvent(type, bubbles, cancelable); 53 initEvent(type, bubbles, cancelable);
54 m_orientation = orientation; 54 m_orientation = DeviceOrientationData::create(alpha, beta, gamma, absolute);
55 } 55 }
56 56
57 double DeviceOrientationEvent::alpha(bool& isNull) const 57 double DeviceOrientationEvent::alpha(bool& isNull) const
58 { 58 {
59 if (m_orientation->canProvideAlpha()) 59 if (m_orientation->canProvideAlpha())
60 return m_orientation->alpha(); 60 return m_orientation->alpha();
61 61
62 isNull = true; 62 isNull = true;
63 return 0; 63 return 0;
64 } 64 }
(...skipping 30 matching lines...) Expand all
95 return EventNames::DeviceOrientationEvent; 95 return EventNames::DeviceOrientationEvent;
96 } 96 }
97 97
98 DEFINE_TRACE(DeviceOrientationEvent) 98 DEFINE_TRACE(DeviceOrientationEvent)
99 { 99 {
100 visitor->trace(m_orientation); 100 visitor->trace(m_orientation);
101 Event::trace(visitor); 101 Event::trace(visitor);
102 } 102 }
103 103
104 } // namespace blink 104 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698