| 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 #ifndef CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_PROVIDER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_PROVIDER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_PROVIDER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/callback.h" | 8 #include "base/callback.h" |
| 11 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/optional.h" |
| 12 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 13 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
| 14 #include "device/screen_orientation/public/interfaces/screen_orientation_lock_ty
pes.mojom.h" | 13 #include "device/screen_orientation/public/interfaces/screen_orientation_lock_ty
pes.mojom.h" |
| 15 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" | 14 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" |
| 16 | 15 |
| 17 namespace content { | 16 namespace content { |
| 18 | 17 |
| 19 class ScreenOrientationDelegate; | 18 class ScreenOrientationDelegate; |
| 20 class WebContents; | 19 class WebContents; |
| 21 | 20 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 bool LockMatchesCurrentOrientation(blink::WebScreenOrientationLockType lock); | 64 bool LockMatchesCurrentOrientation(blink::WebScreenOrientationLockType lock); |
| 66 | 65 |
| 67 // Not owned, responsible for platform implementations. | 66 // Not owned, responsible for platform implementations. |
| 68 static ScreenOrientationDelegate* delegate_; | 67 static ScreenOrientationDelegate* delegate_; |
| 69 | 68 |
| 70 // Whether the ScreenOrientationProvider currently has a lock applied. | 69 // Whether the ScreenOrientationProvider currently has a lock applied. |
| 71 bool lock_applied_; | 70 bool lock_applied_; |
| 72 | 71 |
| 73 // Locks that require orientation changes are not completed until | 72 // Locks that require orientation changes are not completed until |
| 74 // OnOrientationChange. | 73 // OnOrientationChange. |
| 75 | |
| 76 base::Optional<blink::WebScreenOrientationLockType> pending_lock_orientation_; | 74 base::Optional<blink::WebScreenOrientationLockType> pending_lock_orientation_; |
| 77 | 75 |
| 78 LockOrientationCallback on_result_callback_; | 76 LockOrientationCallback pending_callback_; |
| 79 | 77 |
| 80 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationProvider); | 78 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationProvider); |
| 81 }; | 79 }; |
| 82 | 80 |
| 83 } // namespace content | 81 } // namespace content |
| 84 | 82 |
| 85 #endif // CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_PROVIDER_H_ | 83 #endif // CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_PROVIDER_H_ |
| OLD | NEW |