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

Unified Diff: components/sessions/content/content_serialized_navigation_driver.cc

Issue 2166693002: [MD Settings] PROOF OF CONCEPT - DO NOT LAND - URL rewrite (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « chrome/common/chrome_features.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sessions/content/content_serialized_navigation_driver.cc
diff --git a/components/sessions/content/content_serialized_navigation_driver.cc b/components/sessions/content/content_serialized_navigation_driver.cc
index a3305a8695311157429112f3677d91fa124daac5..f1c221239bc3407783ec139d5f0a3438ca172d8e 100644
--- a/components/sessions/content/content_serialized_navigation_driver.cc
+++ b/components/sessions/content/content_serialized_navigation_driver.cc
@@ -11,6 +11,8 @@
#include "content/public/common/referrer.h"
#include "content/public/common/url_constants.h"
+SESSIONS_EXPORT bool (*g_settingsFlagFunc)(void);
+
namespace sessions {
namespace {
@@ -113,6 +115,25 @@ void ContentSerializedNavigationDriver::Sanitize(
StripReferrerFromPageState(navigation->encoded_page_state_);
}
+ if (g_settingsFlagFunc &&
Dan Beam 2016/07/21 23:36:18 can we plumb this through ContentBrowserClient? c
groby-ooo-7-16 2016/07/26 00:23:09 That was the plan, until I started digging deeper.
+ navigation->virtual_url_.SchemeIs(content::kChromeUIScheme)) {
+ if (g_settingsFlagFunc() &&
+ navigation->original_request_url().spec() ==
+ "chrome://chrome/settings/") {
+ navigation->original_request_url_ = GURL("chrome://settings/");
+ navigation->encoded_page_state_ =
+ content::PageState::CreateFromURL(navigation->original_request_url_)
+ .ToEncodedData();
+ }
+ if (!g_settingsFlagFunc() &&
+ navigation->original_request_url().spec() == "chrome://settings/") {
+ navigation->original_request_url_ = GURL("chrome://chrome/settings/");
+ navigation->encoded_page_state_ =
+ content::PageState::CreateFromURL(navigation->original_request_url_)
+ .ToEncodedData();
+ }
+ }
+
#if defined(OS_ANDROID)
// Rewrite the old new tab and welcome page URLs to the new NTP URL.
if (navigation->virtual_url_.SchemeIs(content::kChromeUIScheme) &&
« no previous file with comments | « chrome/common/chrome_features.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698