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

Unified Diff: chrome/browser/search/search.cc

Issue 13877028: Renderer initiated navigations from non instant process should not fall into instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing another recently added test. Created 7 years, 8 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/browser/search/search.h ('k') | chrome/browser/ui/search/instant_extended_interactive_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/search.cc
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index 12bc7c6f7a783154d8280f0a295c2701b45d7155..b3f7fd7e7d4c6be093fa8875022e53371d9fc299 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -499,6 +499,28 @@ bool MatchesOriginAndPath(const GURL& my_url, const GURL& other_url) {
return MatchesOrigin(my_url, other_url) && my_url.path() == other_url.path();
}
+GURL GetPrivilegedURLForInstant(const GURL& url, Profile* profile) {
+ CHECK(ShouldAssignURLToInstantRenderer(url, profile))
+ << "Error granting Instant access.";
+
+ if (IsPrivilegedURLForInstant(url))
+ return url;
+
+ GURL privileged_url(url);
+
+ // Replace the scheme with "chrome-search:".
+ url_canon::Replacements<char> replacements;
+ std::string search_scheme(chrome::kChromeSearchScheme);
+ replacements.SetScheme(search_scheme.data(),
+ url_parse::Component(0, search_scheme.length()));
+ privileged_url = privileged_url.ReplaceComponents(replacements);
+ return privileged_url;
+}
+
+bool IsPrivilegedURLForInstant(const GURL& url) {
+ return url.SchemeIs(chrome::kChromeSearchScheme);
+}
+
void EnableInstantExtendedAPIForTesting() {
CommandLine* cl = CommandLine::ForCurrentProcess();
cl->AppendSwitch(switches::kEnableInstantExtendedAPI);
« no previous file with comments | « chrome/browser/search/search.h ('k') | chrome/browser/ui/search/instant_extended_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698