Chromium Code Reviews| 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) && |