| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browser/screen_orientation/screen_orientation_delegate_win.h" | 5 #include "content/browser/screen_orientation/screen_orientation_delegate_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "content/public/browser/screen_orientation_provider.h" | 9 #include "content/browser/screen_orientation/screen_orientation_provider.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 // SetDisplayAutoRotationPreferences is available on Windows 8 and after. | 13 // SetDisplayAutoRotationPreferences is available on Windows 8 and after. |
| 14 void SetDisplayAutoRotationPreferencesWrapper( | 14 void SetDisplayAutoRotationPreferencesWrapper( |
| 15 ORIENTATION_PREFERENCE orientation) { | 15 ORIENTATION_PREFERENCE orientation) { |
| 16 using SetDisplayAutoRotationPreferencesPtr = | 16 using SetDisplayAutoRotationPreferencesPtr = |
| 17 void(WINAPI*)(ORIENTATION_PREFERENCE); | 17 void(WINAPI*)(ORIENTATION_PREFERENCE); |
| 18 static SetDisplayAutoRotationPreferencesPtr | 18 static SetDisplayAutoRotationPreferencesPtr |
| 19 set_display_auto_rotation_preferences_func = | 19 set_display_auto_rotation_preferences_func = |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 !(auto_rotation_state & AR_NOSENSOR) && | 124 !(auto_rotation_state & AR_NOSENSOR) && |
| 125 !(auto_rotation_state & AR_NOT_SUPPORTED) && | 125 !(auto_rotation_state & AR_NOT_SUPPORTED) && |
| 126 !(auto_rotation_state & AR_MULTIMON)); | 126 !(auto_rotation_state & AR_MULTIMON)); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void ScreenOrientationDelegateWin::Unlock(WebContents* web_contents) { | 129 void ScreenOrientationDelegateWin::Unlock(WebContents* web_contents) { |
| 130 SetDisplayAutoRotationPreferencesWrapper(ORIENTATION_PREFERENCE_NONE); | 130 SetDisplayAutoRotationPreferencesWrapper(ORIENTATION_PREFERENCE_NONE); |
| 131 } | 131 } |
| 132 | 132 |
| 133 } // namespace content | 133 } // namespace content |
| OLD | NEW |