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

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

Issue 2391883006: Mojo-ify implementation of screen orientation locking/unlocking. (Closed)
Patch Set: Moved enum mojo definition to content/common due to dependency issue Created 4 years, 2 months 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_SERVICE_IMPL_H
6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_SERVICE_IMPL_H
7
8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h"
10 #include "content/common/screen_orientation_service.mojom.h"
11 #include "mojo/public/cpp/bindings/strong_binding.h"
12
13 namespace content {
14
15 class ScreenOrientationProvider;
16
17 class ScreenOrientationServiceImpl : public mojom::ScreenOrientationService {
18 public:
19 static void Create(ScreenOrientationProvider* provider,
20 mojom::ScreenOrientationServiceRequest request);
21
22 private:
23 ScreenOrientationServiceImpl(ScreenOrientationProvider* provider,
24 mojom::ScreenOrientationServiceRequest request);
25 ~ScreenOrientationServiceImpl() override;
26
27 // ScreenOrientationService:
28 void LockOrientation(blink::WebScreenOrientationLockType orientation,
29 const LockOrientationCallback& callback) override;
30 void UnlockOrientation() override;
31
32 void NotifyLockResult(mojom::ScreenOrientationLockResult result);
33
34 ScreenOrientationProvider* provider_;
35 LockOrientationCallback on_result_callback_;
36 mojo::Binding<mojom::ScreenOrientationService> binding_;
37 base::WeakPtrFactory<ScreenOrientationServiceImpl> weak_factory_;
38 };
39
40 } // namespace content
41
42 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_SERVICE_IMPL_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698