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

Unified Diff: content/browser/screen_orientation/screen_orientation_provider.h

Issue 2685513002: [For trybots test] [ScreenOrientation] Hide ScreenOrientationProvider inside WebContentsImpl. (Closed)
Patch Set: Fix android bots Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/screen_orientation/screen_orientation_provider.h
diff --git a/content/public/browser/screen_orientation_provider.h b/content/browser/screen_orientation/screen_orientation_provider.h
similarity index 73%
rename from content/public/browser/screen_orientation_provider.h
rename to content/browser/screen_orientation/screen_orientation_provider.h
index 1ee9d828ea45ca7394a795ef7ae79de31af7ad0e..0898070e3bb9471d3fee37c606deb4faf5e85720 100644
--- a/content/public/browser/screen_orientation_provider.h
+++ b/content/browser/screen_orientation/screen_orientation_provider.h
@@ -2,14 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_PROVIDER_H_
-#define CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_PROVIDER_H_
+#ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_H_
+#define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_H_
#include "base/callback.h"
+#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/optional.h"
#include "content/common/content_export.h"
+#include "content/public/browser/web_contents_binding_set.h"
#include "content/public/browser/web_contents_observer.h"
+#include "device/screen_orientation/public/interfaces/screen_orientation.mojom.h"
#include "device/screen_orientation/public/interfaces/screen_orientation_lock_types.mojom.h"
#include "third_party/WebKit/public/platform/modules/screen_orientation/WebScreenOrientationLockType.h"
@@ -18,24 +21,20 @@ namespace content {
class ScreenOrientationDelegate;
class WebContents;
-using LockOrientationCallback =
- base::Callback<void(device::mojom::ScreenOrientationLockResult)>;
-
// Handles screen orientation lock/unlock. Platforms which wish to provide
// custom implementations can provide a factory for ScreenOrientationDelegate.
-class CONTENT_EXPORT ScreenOrientationProvider : public WebContentsObserver {
+class CONTENT_EXPORT ScreenOrientationProvider
+ : NON_EXPORTED_BASE(public device::mojom::ScreenOrientation),
+ public WebContentsObserver {
public:
ScreenOrientationProvider(WebContents* web_contents);
~ScreenOrientationProvider() override;
- // Lock the screen orientation to |orientation|, |callback| is the callback
- // that should be invoked when this request receives a result.
+ // device::mojom::ScreenOrientation:
void LockOrientation(blink::WebScreenOrientationLockType orientation,
- const LockOrientationCallback& callback);
-
- // Unlock the screen orientation.
- void UnlockOrientation();
+ const LockOrientationCallback& callback) override;
+ void UnlockOrientation() override;
// Inform about a screen orientation update. It is called to let the provider
// know if a lock has been resolved.
@@ -48,6 +47,7 @@ class CONTENT_EXPORT ScreenOrientationProvider : public WebContentsObserver {
// WebContentsObserver
void DidToggleFullscreenModeForTab(bool entered_fullscreen,
bool will_cause_resize) override;
+ void DidFinishNavigation(NavigationHandle* navigation_handle) override;
private:
// Calls on |on_result_callback_| with |result|, followed by resetting
@@ -69,15 +69,17 @@ class CONTENT_EXPORT ScreenOrientationProvider : public WebContentsObserver {
// Whether the ScreenOrientationProvider currently has a lock applied.
bool lock_applied_;
- // Locks that require orientation changes are not completed until
+ // Lock that require orientation changes are not completed until
// OnOrientationChange.
base::Optional<blink::WebScreenOrientationLockType> pending_lock_orientation_;
LockOrientationCallback pending_callback_;
+ WebContentsFrameBindingSet<device::mojom::ScreenOrientation> bindings_;
+
DISALLOW_COPY_AND_ASSIGN(ScreenOrientationProvider);
};
-} // namespace content
+} // namespace content
-#endif // CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_PROVIDER_H_
+#endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698