Commit 56079c7a authored by Lukasz Anforowicz's avatar Lukasz Anforowicz Committed by Commit Bot

Don't reset PageState when restoring chrome://history (or similar URLs).

This CL reverts r420600 and r459047 - now that MD history and MD
settings have shipped long time ago, there is no need to reset PageState
to avoid mixups when restoring MD-disabled PageState into an MD-enabled
chrome://settings and vice-versa.  This aspect of the CL affects only
the following 3 URLs:
- chrome://history
- chrome://settings
- chrome://help

Bug: 614758, 700350, 976055
Change-Id: I782664d9940c25406f3cd4a226692b75de6bfc48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808089
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: default avatarRachel Blum <groby@chromium.org>
Reviewed-by: default avatarChris Hamilton <chrisha@chromium.org>
Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698623}
parent 7c77b847
......@@ -15,17 +15,6 @@
#include "content/public/common/page_state.h"
#endif
namespace {
bool ShouldClearPageState(const GURL& url) {
return url.SchemeIs(content::kChromeUIScheme) &&
(url.host_piece() == chrome::kChromeUIHistoryHost ||
url.host_piece() == chrome::kChromeUISettingsHost ||
url.host_piece() == chrome::kChromeUIHelpHost);
}
} // namespace
ChromeSerializedNavigationDriver::~ChromeSerializedNavigationDriver() {}
// static
......@@ -44,11 +33,6 @@ void ChromeSerializedNavigationDriver::Sanitize(
content::Referrer new_referrer = content::Referrer::SanitizeForRequest(
navigation->virtual_url(), old_referrer);
if (ShouldClearPageState(navigation->virtual_url()) &&
ShouldClearPageState(navigation->original_request_url())) {
navigation->set_encoded_page_state(std::string());
}
// No need to compare the policy, as it doesn't change during
// sanitization. If there has been a change, the referrer needs to be
// stripped from the page state as well.
......
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