| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 #include "modules/screen_orientation/OrientationInformation.h" | |
| 7 | |
| 8 #include "modules/screen_orientation/ScreenOrientation.h" | |
| 9 | |
| 10 namespace WebCore { | |
| 11 | |
| 12 OrientationInformation::OrientationInformation() | |
| 13 : m_type(blink::WebScreenOrientationUndefined) | |
| 14 , m_angle(0) | |
| 15 { | |
| 16 ScriptWrappable::init(this); | |
| 17 } | |
| 18 | |
| 19 bool OrientationInformation::initialized() const | |
| 20 { | |
| 21 return m_type != blink::WebScreenOrientationUndefined; | |
| 22 } | |
| 23 | |
| 24 String OrientationInformation::type() const | |
| 25 { | |
| 26 return ScreenOrientation::orientationTypeToString(m_type); | |
| 27 } | |
| 28 | |
| 29 unsigned short OrientationInformation::angle() const | |
| 30 { | |
| 31 return m_angle; | |
| 32 } | |
| 33 | |
| 34 void OrientationInformation::setType(blink::WebScreenOrientationType type) | |
| 35 { | |
| 36 ASSERT(type != blink::WebScreenOrientationUndefined); | |
| 37 m_type = type; | |
| 38 } | |
| 39 | |
| 40 void OrientationInformation::setAngle(unsigned short angle) | |
| 41 { | |
| 42 m_angle = angle; | |
| 43 } | |
| 44 | |
| 45 } // namespace WebCore | |
| OLD | NEW |