Chromium Code Reviews| Index: content/browser/screen_orientation/screen_orientation_impl.h |
| diff --git a/content/browser/screen_orientation/screen_orientation_impl.h b/content/browser/screen_orientation/screen_orientation_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5aecafc99ec1757129f68ebd6a2ccc01edbc35e9 |
| --- /dev/null |
| +++ b/content/browser/screen_orientation/screen_orientation_impl.h |
| @@ -0,0 +1,47 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_IMPL_H |
|
blundell
2016/10/28 21:21:32
nit: this file should be called screen_orientation
lunalu1
2016/10/31 18:02:53
Done.
|
| +#define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_IMPL_H |
| + |
| +#include "base/callback.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "content/common/screen_orientation_interface.mojom.h" |
| +#include "content/public/browser/web_contents_binding_set.h" |
| +#include "content/public/browser/web_contents_observer.h" |
| + |
| +namespace content { |
| + |
| +class ScreenOrientationProvider; |
| +class WebContents; |
| + |
| +class ScreenOrientation |
| + : public mojom::ScreenOrientation, |
| + public WebContentsObserver { |
| + public: |
| + ScreenOrientation(WebContents* web_contents); |
| + ~ScreenOrientation() override; |
| + |
| + ScreenOrientationProvider* GetScreenOrientationProvider(); |
| + |
| + private: |
| + // ScreenOrientation: |
| + void LockOrientation(::blink::WebScreenOrientationLockType orientation, |
| + const LockOrientationCallback& callback) override; |
| + void UnlockOrientation() override; |
| + // WebContentsObserver: |
| + void DidNavigateMainFrame(const LoadCommittedDetails& details, |
| + const FrameNavigateParams& params) override; |
| + |
| + void NotifyLockResult(::blink::mojom::ScreenOrientationLockResult result); |
| + |
| + std::unique_ptr<ScreenOrientationProvider> provider_; |
| + LockOrientationCallback on_result_callback_; |
| + WebContentsFrameBindingSet<mojom::ScreenOrientation> binding_; |
|
blundell
2016/10/28 21:21:32
nit: |bindings_|
lunalu1
2016/10/31 18:02:53
Done.
|
| + base::WeakPtrFactory<ScreenOrientation> weak_factory_; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_IMPL_H |