| Index: chrome/browser/search/search.cc
|
| diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
|
| index ba0820034c10d4e72a5531096e2dc58eae104b0b..0eafe76382062ca913605eb41b871e18f0f07d7d 100644
|
| --- a/chrome/browser/search/search.cc
|
| +++ b/chrome/browser/search/search.cc
|
| @@ -497,6 +497,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);
|
|
|