OLD | NEW |
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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 #include "modules/device_orientation/DeviceOrientationController.h" | 33 #include "modules/device_orientation/DeviceOrientationController.h" |
34 #include "modules/device_orientation/DeviceOrientationData.h" | 34 #include "modules/device_orientation/DeviceOrientationData.h" |
35 #include "public/platform/Platform.h" | 35 #include "public/platform/Platform.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 DeviceOrientationDispatcher& DeviceOrientationDispatcher::instance(bool absolute
) | 39 DeviceOrientationDispatcher& DeviceOrientationDispatcher::instance(bool absolute
) |
40 { | 40 { |
41 if (absolute) { | 41 if (absolute) { |
42 DEFINE_STATIC_LOCAL(Persistent<DeviceOrientationDispatcher>, deviceOrien
tationAbsoluteDispatcher, (new DeviceOrientationDispatcher(absolute))); | 42 DEFINE_STATIC_LOCAL(DeviceOrientationDispatcher, deviceOrientationAbsolu
teDispatcher, (new DeviceOrientationDispatcher(absolute))); |
43 return *deviceOrientationAbsoluteDispatcher; | 43 return deviceOrientationAbsoluteDispatcher; |
44 } | 44 } |
45 DEFINE_STATIC_LOCAL(Persistent<DeviceOrientationDispatcher>, deviceOrientati
onDispatcher, (new DeviceOrientationDispatcher(absolute))); | 45 DEFINE_STATIC_LOCAL(DeviceOrientationDispatcher, deviceOrientationDispatcher
, (new DeviceOrientationDispatcher(absolute))); |
46 return *deviceOrientationDispatcher; | 46 return deviceOrientationDispatcher; |
47 } | 47 } |
48 | 48 |
49 DeviceOrientationDispatcher::DeviceOrientationDispatcher(bool absolute) : m_abso
lute(absolute) | 49 DeviceOrientationDispatcher::DeviceOrientationDispatcher(bool absolute) : m_abso
lute(absolute) |
50 { | 50 { |
51 } | 51 } |
52 | 52 |
53 DeviceOrientationDispatcher::~DeviceOrientationDispatcher() | 53 DeviceOrientationDispatcher::~DeviceOrientationDispatcher() |
54 { | 54 { |
55 } | 55 } |
56 | 56 |
(...skipping 24 matching lines...) Expand all Loading... |
81 { | 81 { |
82 return m_lastDeviceOrientationData.get(); | 82 return m_lastDeviceOrientationData.get(); |
83 } | 83 } |
84 | 84 |
85 WebPlatformEventType DeviceOrientationDispatcher::getWebPlatformEventType() cons
t | 85 WebPlatformEventType DeviceOrientationDispatcher::getWebPlatformEventType() cons
t |
86 { | 86 { |
87 return (m_absolute) ? WebPlatformEventTypeDeviceOrientationAbsolute : WebPla
tformEventTypeDeviceOrientation; | 87 return (m_absolute) ? WebPlatformEventTypeDeviceOrientationAbsolute : WebPla
tformEventTypeDeviceOrientation; |
88 } | 88 } |
89 | 89 |
90 } // namespace blink | 90 } // namespace blink |
OLD | NEW |