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

Unified Diff: content/public/browser/screen_orientation_provider.cc

Issue 2649823002: [ScreenOrientation] Merge ScreenOrientation into ScreenOrientationProvider. (Closed)
Patch Set: Add initial tests Created 3 years, 11 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/public/browser/screen_orientation_provider.cc
diff --git a/content/public/browser/screen_orientation_provider.cc b/content/public/browser/screen_orientation_provider.cc
index 7da24eb3d02a3f4605f178b9386710303c172498..da569116249a7e2fce74fa704ce711c681fddb34 100644
--- a/content/public/browser/screen_orientation_provider.cc
+++ b/content/public/browser/screen_orientation_provider.cc
@@ -19,7 +19,9 @@ using device::mojom::ScreenOrientationLockResult;
ScreenOrientationDelegate* ScreenOrientationProvider::delegate_ = nullptr;
ScreenOrientationProvider::ScreenOrientationProvider(WebContents* web_contents)
- : WebContentsObserver(web_contents), lock_applied_(false) {}
+ : WebContentsObserver(web_contents),
+ lock_applied_(false),
+ bindings_(web_contents, this) {}
ScreenOrientationProvider::~ScreenOrientationProvider() {
}
@@ -106,9 +108,9 @@ void ScreenOrientationProvider::OnOrientationChange() {
void ScreenOrientationProvider::NotifyLockResult(
ScreenOrientationLockResult result) {
- if (!pending_callback_.is_null()) {
+ if (!pending_callback_.is_null())
base::ResetAndReturn(&pending_callback_).Run(result);
- }
+
pending_lock_orientation_.reset();
}
@@ -131,6 +133,14 @@ void ScreenOrientationProvider::DidToggleFullscreenModeForTab(
UnlockOrientation();
}
+void ScreenOrientationProvider::DidNavigateMainFrame(
+ const LoadCommittedDetails& details,
+ const FrameNavigateParams& params) {
+ if (details.is_in_page)
+ return;
+ UnlockOrientation();
+}
+
blink::WebScreenOrientationLockType
ScreenOrientationProvider::GetNaturalLockType() const {
RenderWidgetHost* rwh = web_contents()->GetRenderViewHost()->GetWidget();

Powered by Google App Engine
This is Rietveld 408576698