Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: content/browser/screen_orientation/screen_orientation.h

Issue 2391883006: Mojo-ify implementation of screen orientation locking/unlocking. (Closed)
Patch Set: clup Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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/callback.h"
9 #include "base/memory/weak_ptr.h"
10 #include "content/common/screen_orientation.mojom.h"
11 #include "content/public/browser/web_contents_binding_set.h"
12 #include "content/public/browser/web_contents_observer.h"
13
14 namespace content {
15
16 class ScreenOrientationProvider;
17 class WebContents;
18
19 class ScreenOrientation : public mojom::ScreenOrientation,
20 public WebContentsObserver {
21 public:
22 explicit ScreenOrientation(WebContents* web_contents);
23 ~ScreenOrientation() override;
24
25 ScreenOrientationProvider* GetScreenOrientationProvider();
26
27 private:
28 // ScreenOrientation:
29 void LockOrientation(blink::WebScreenOrientationLockType orientation,
30 const LockOrientationCallback& callback) override;
31 void UnlockOrientation() override;
32
33 // WebContentsObserver:
34 void DidNavigateMainFrame(const LoadCommittedDetails& details,
35 const FrameNavigateParams& params) override;
36
37 void NotifyLockResult(blink::mojom::ScreenOrientationLockResult result);
38
39 std::unique_ptr<ScreenOrientationProvider> provider_;
40 LockOrientationCallback on_result_callback_;
41 WebContentsFrameBindingSet<mojom::ScreenOrientation> bindings_;
42 base::WeakPtrFactory<ScreenOrientation> weak_factory_;
43 };
44
45 } // namespace content
46
47 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_H
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_delegate.cc ('k') | content/browser/screen_orientation/screen_orientation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698