| OLD | NEW | 
|    1 // Copyright 2014 The Chromium Authors. All rights reserved. |    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 |    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 "config.h" |    5 #include "config.h" | 
|    6 #include "modules/screen_orientation/ScreenOrientation.h" |    6 #include "modules/screen_orientation/ScreenOrientation.h" | 
|    7  |    7  | 
|    8 #include "core/frame/DOMWindow.h" |    8 #include "core/frame/DOMWindow.h" | 
|    9 #include "core/frame/LocalFrame.h" |    9 #include "core/frame/LocalFrame.h" | 
|   10 #include "core/frame/Screen.h" |   10 #include "core/frame/Screen.h" | 
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   76     , m_lockedOrientations(WebScreenOrientationDefault) |   76     , m_lockedOrientations(WebScreenOrientationDefault) | 
|   77 { |   77 { | 
|   78 } |   78 } | 
|   79  |   79  | 
|   80 void ScreenOrientation::lockOrientationAsync(blink::WebScreenOrientations orient
     ations) |   80 void ScreenOrientation::lockOrientationAsync(blink::WebScreenOrientations orient
     ations) | 
|   81 { |   81 { | 
|   82     if (m_lockedOrientations == orientations) |   82     if (m_lockedOrientations == orientations) | 
|   83         return; |   83         return; | 
|   84     m_lockedOrientations = orientations; |   84     m_lockedOrientations = orientations; | 
|   85     if (!m_orientationLockTimer.isActive()) |   85     if (!m_orientationLockTimer.isActive()) | 
|   86         m_orientationLockTimer.startOneShot(0); |   86         m_orientationLockTimer.startOneShot(0, FROM_HERE); | 
|   87 } |   87 } | 
|   88  |   88  | 
|   89 void ScreenOrientation::orientationLockTimerFired(Timer<ScreenOrientation>*) |   89 void ScreenOrientation::orientationLockTimerFired(Timer<ScreenOrientation>*) | 
|   90 { |   90 { | 
|   91     if (m_lockedOrientations == WebScreenOrientationDefault) |   91     if (m_lockedOrientations == WebScreenOrientationDefault) | 
|   92         blink::Platform::current()->unlockOrientation(); |   92         blink::Platform::current()->unlockOrientation(); | 
|   93     else |   93     else | 
|   94         blink::Platform::current()->lockOrientation(m_lockedOrientations); |   94         blink::Platform::current()->lockOrientation(m_lockedOrientations); | 
|   95 } |   95 } | 
|   96  |   96  | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  153     ScreenOrientation::from(screen).lockOrientationAsync(orientations); |  153     ScreenOrientation::from(screen).lockOrientationAsync(orientations); | 
|  154     return true; |  154     return true; | 
|  155 } |  155 } | 
|  156  |  156  | 
|  157 void ScreenOrientation::unlockOrientation(Screen& screen) |  157 void ScreenOrientation::unlockOrientation(Screen& screen) | 
|  158 { |  158 { | 
|  159     ScreenOrientation::from(screen).lockOrientationAsync(WebScreenOrientationDef
     ault); |  159     ScreenOrientation::from(screen).lockOrientationAsync(WebScreenOrientationDef
     ault); | 
|  160 } |  160 } | 
|  161  |  161  | 
|  162 } // namespace WebCore |  162 } // namespace WebCore | 
| OLD | NEW |