| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 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 #include "base/callback.h" |
| 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "content/browser/screen_orientation/screen_orientation_context.h" |
| 8 #include "content/common/screen_orientation_service.mojom.h" |
| 9 |
| 10 #ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_SERVICE_IMPL_H_ |
| 11 #define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_SERVICE_IMPL_H_ |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class ScreenOrientationProvider; |
| 16 class WebContents; |
| 17 |
| 18 class ScreenOrientationServiceImpl |
| 19 : public mojo::InterfaceImpl<ScreenOrientationService>, |
| 20 public ScreenOrientationContext::Observer { |
| 21 public: |
| 22 static void Create(WebContents* web_contents, |
| 23 mojo::InterfaceRequest<ScreenOrientationService> request); |
| 24 |
| 25 void NotifyLockResult(ScreenOrientationLockResult result); |
| 26 |
| 27 private: |
| 28 ScreenOrientationServiceImpl(WebContents* web_contents); |
| 29 virtual ~ScreenOrientationServiceImpl(); |
| 30 |
| 31 // ScreenOrientationContext::Observer: |
| 32 virtual void OnScreenOrientationChange() OVERRIDE; |
| 33 virtual void OnNewLockRequest() OVERRIDE; |
| 34 |
| 35 // ScreenOrientationService: |
| 36 virtual void LockOrientation( |
| 37 ScreenOrientationLockType lock_type, |
| 38 const mojo::Callback<void(ScreenOrientationLockResult)>& callback) |
| 39 OVERRIDE; |
| 40 virtual void UnlockOrientation() OVERRIDE; |
| 41 |
| 42 ScreenOrientationContext* context_; |
| 43 scoped_ptr<ScreenOrientationProvider> provider_; |
| 44 mojo::Callback<void(ScreenOrientationLockResult)> on_result_callback_; |
| 45 }; |
| 46 |
| 47 } // namespace content |
| 48 |
| 49 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_SERVICE_IMPL_H_ |
| OLD | NEW |