Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / browser / browser_url_handler_impl.cc
index 71e3599..7ea7ff7 100644 (file)
@@ -62,12 +62,8 @@ static bool ReverseViewSource(GURL* url, BrowserContext* browser_context) {
   // No action necessary if the URL is already view-source:
   if (url->SchemeIs(kViewSourceScheme))
     return false;
-
-  url::Replacements<char> repl;
-  repl.SetScheme(kViewSourceScheme,
-                 url::Component(0, strlen(kViewSourceScheme)));
-  repl.SetPath(url->spec().c_str(), url::Component(0, url->spec().size()));
-  *url = url->ReplaceComponents(repl);
+  // Recreate the url with the view-source scheme.
+  *url = GURL(kViewSourceScheme + std::string(":") + url->spec());
   return true;
 }