Commit 96d26e24 authored by jam's avatar jam Committed by Commit bot

Convert ScreenOrientation to use the new navigation callbacks.

BUG=682002

Review-Url: https://codereview.chromium.org/2668833002
Cr-Commit-Position: refs/heads/master@{#447924}
parent d8126246
......@@ -4,7 +4,7 @@
#include "content/browser/screen_orientation/screen_orientation.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/screen_orientation_provider.h"
#include "content/public/browser/web_contents.h"
......@@ -29,11 +29,13 @@ void ScreenOrientation::UnlockOrientation() {
provider_->UnlockOrientation();
}
void ScreenOrientation::DidNavigateMainFrame(
const LoadCommittedDetails& details,
const FrameNavigateParams& params) {
if (details.is_in_page)
void ScreenOrientation::DidFinishNavigation(
NavigationHandle* navigation_handle) {
if (!navigation_handle->IsInMainFrame() ||
!navigation_handle->HasCommitted() ||
navigation_handle->IsSamePage()) {
return;
}
provider_->UnlockOrientation();
}
......
......@@ -30,8 +30,7 @@ class ScreenOrientation : public device::mojom::ScreenOrientation,
void UnlockOrientation() override;
// WebContentsObserver:
void DidNavigateMainFrame(const LoadCommittedDetails& details,
const FrameNavigateParams& params) override;
void DidFinishNavigation(NavigationHandle* navigation_handle) override;
std::unique_ptr<ScreenOrientationProvider> provider_;
WebContentsFrameBindingSet<device::mojom::ScreenOrientation> bindings_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment