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

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

Issue 2391883006: Mojo-ify implementation of screen orientation locking/unlocking. (Closed)
Patch Set: Codereview update Created 4 years, 1 month 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_IMPL_H
6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_IMPL_H
7
8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h"
10 #include "content/common/screen_orientation_interface.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
blundell 2016/10/25 16:09:26 ah you already renamed the class, great! so it's j
lunalu1 2016/11/03 23:15:25 Done.
20 : public mojom::ScreenOrientation,
21 public WebContentsObserver {
22 public:
23 ScreenOrientation(WebContents* web_contents);
24 ~ScreenOrientation() override;
25
26 ScreenOrientationProvider* GetScreenOrientationProvider();
27
28 private:
29 // ScreenOrientation:
30 void LockOrientation(::blink::WebScreenOrientationLockType orientation,
31 const LockOrientationCallback& callback) override;
32 void UnlockOrientation() override;
33 // WebContentsObserver:
blundell 2016/10/25 16:09:26 nit: blank line before
lunalu1 2016/11/03 23:15:25 Done.
34 void DidNavigateMainFrame(const LoadCommittedDetails& details,
35 const FrameNavigateParams& params) override;
36
37 void NotifyLockResult(::blink::mojom::ScreenOrientationLockResult result);
38
39 WebContents* web_contents_;
blundell 2016/10/25 16:09:26 nit: if it's a WCO it can just use web_contents()
lunalu1 2016/11/03 23:15:25 Done.
40 std::unique_ptr<ScreenOrientationProvider> provider_;
41 LockOrientationCallback on_result_callback_;
42 WebContentsFrameBindingSet<mojom::ScreenOrientation> binding_;
blundell 2016/10/25 16:09:26 is this called binding_ or bindings_ in other clas
Ken Rockot(use gerrit already) 2016/10/26 22:00:44 bindings_ is probably a better name. There's a bin
lunalu1 2016/11/03 23:15:25 Done.
43 base::WeakPtrFactory<ScreenOrientation> weak_factory_;
44 };
45
46 } // namespace content
47
48 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_IMPL_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698