| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_H | |
| 6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_H | |
| 7 | |
| 8 #include "base/memory/weak_ptr.h" | |
| 9 #include "content/public/browser/web_contents_binding_set.h" | |
| 10 #include "content/public/browser/web_contents_observer.h" | |
| 11 #include "device/screen_orientation/public/interfaces/screen_orientation.mojom.h
" | |
| 12 | |
| 13 namespace content { | |
| 14 | |
| 15 class ScreenOrientationProvider; | |
| 16 class WebContents; | |
| 17 | |
| 18 class ScreenOrientation : public device::mojom::ScreenOrientation, | |
| 19 public WebContentsObserver { | |
| 20 public: | |
| 21 explicit ScreenOrientation(WebContents* web_contents); | |
| 22 ~ScreenOrientation() override; | |
| 23 | |
| 24 ScreenOrientationProvider* GetScreenOrientationProvider(); | |
| 25 | |
| 26 private: | |
| 27 // ScreenOrientation: | |
| 28 void LockOrientation(blink::WebScreenOrientationLockType orientation, | |
| 29 const LockOrientationCallback& callback) override; | |
| 30 void UnlockOrientation() override; | |
| 31 | |
| 32 // WebContentsObserver: | |
| 33 void DidFinishNavigation(NavigationHandle* navigation_handle) override; | |
| 34 | |
| 35 std::unique_ptr<ScreenOrientationProvider> provider_; | |
| 36 WebContentsFrameBindingSet<device::mojom::ScreenOrientation> bindings_; | |
| 37 base::WeakPtrFactory<ScreenOrientation> weak_factory_; | |
| 38 }; | |
| 39 | |
| 40 } // namespace content | |
| 41 | |
| 42 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_H | |
| OLD | NEW |