summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbeaudoin@chromium.org <beaudoin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-24 00:17:07 +0000
committerbeaudoin@chromium.org <beaudoin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-24 00:17:07 +0000
commitd18cdb92c3b02b6835b0b3c62f9fc7fcc7f91b5a (patch)
treee56a0f73b37781609065d70485f6de18480a58a2
parent7f4fc416afb649f05bd036d81e9cd1e2235fbc98 (diff)
downloadchromium_src-d18cdb92c3b02b6835b0b3c62f9fc7fcc7f91b5a.zip
chromium_src-d18cdb92c3b02b6835b0b3c62f9fc7fcc7f91b5a.tar.gz
chromium_src-d18cdb92c3b02b6835b0b3c62f9fc7fcc7f91b5a.tar.bz2
Getting rid of IsInstantExtendedAPIGoogleSearchUrl now that it is no longer needed.
BUG=161602 Review URL: https://chromiumcodereview.appspot.com/12317057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184333 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/google/google_util.cc23
-rw-r--r--chrome/browser/google/google_util.h3
-rw-r--r--chrome/browser/google/google_util_unittest.cc30
3 files changed, 0 insertions, 56 deletions
diff --git a/chrome/browser/google/google_util.cc b/chrome/browser/google/google_util.cc
index 730c701..f3d0575 100644
--- a/chrome/browser/google/google_util.cc
+++ b/chrome/browser/google/google_util.cc
@@ -242,29 +242,6 @@ bool IsGoogleSearchUrl(const std::string& url) {
(!is_home_page_base && HasQueryParameter(query));
}
-bool IsInstantExtendedAPIGoogleSearchUrl(const std::string& url) {
- if (!IsGoogleSearchUrl(url))
- return false;
-
- const std::string embedded_search_key = kInstantExtendedAPIParam;
-
- url_parse::Parsed parsed_url;
- url_parse::ParseStandardURL(url.c_str(), url.length(), &parsed_url);
- url_parse::Component key, value;
- while (url_parse::ExtractQueryKeyValue(
- url.c_str(), &parsed_url.query, &key, &value)) {
- // If the parameter key is |embedded_search_key| and the value is not 0 this
- // is an Instant Extended API Google search URL.
- if (!url.compare(key.begin, key.len, embedded_search_key)) {
- int int_value = 0;
- if (value.is_nonempty())
- base::StringToInt(url.substr(value.begin, value.len), &int_value);
- return int_value != 0;
- }
- }
- return false;
-}
-
bool IsOrganic(const std::string& brand) {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kOrganicInstall))
diff --git a/chrome/browser/google/google_util.h b/chrome/browser/google/google_util.h
index b398bfa..609ee66 100644
--- a/chrome/browser/google/google_util.h
+++ b/chrome/browser/google/google_util.h
@@ -80,9 +80,6 @@ bool IsGoogleHostname(const std::string& host,
bool IsGoogleHomePageUrl(const std::string& url);
// True if |url| represents a valid Google search URL.
bool IsGoogleSearchUrl(const std::string& url);
-// True if |url| represents a valid Google search URL used by the Instant
-// Extended API.
-bool IsInstantExtendedAPIGoogleSearchUrl(const std::string& url);
// True if a build is strictly organic, according to its brand code.
bool IsOrganic(const std::string& brand);
diff --git a/chrome/browser/google/google_util_unittest.cc b/chrome/browser/google/google_util_unittest.cc
index fa3db0a..cf4c610 100644
--- a/chrome/browser/google/google_util_unittest.cc
+++ b/chrome/browser/google/google_util_unittest.cc
@@ -12,7 +12,6 @@
using google_util::IsGoogleDomainUrl;
using google_util::IsGoogleHomePageUrl;
using google_util::IsGoogleSearchUrl;
-using google_util::IsInstantExtendedAPIGoogleSearchUrl;
TEST(GoogleUtilTest, GoodHomePagesNonSecure) {
// Valid home page hosts.
@@ -247,35 +246,6 @@ TEST(GoogleUtilTest, BadSearches) {
"http://www.google.com/WEBHP#q=something"));
}
-TEST(GoogleUtilTest, IsInstantExtendedAPIGoogleSearchUrl) {
- EXPECT_TRUE(IsInstantExtendedAPIGoogleSearchUrl(
- "http://www.google.com/search?q=something&espv=1"));
- EXPECT_TRUE(IsInstantExtendedAPIGoogleSearchUrl(
- "http://www.google.com/search?q=something&espv=3"));
- EXPECT_TRUE(IsInstantExtendedAPIGoogleSearchUrl(
- "http://www.google.com/search?q=something&espv=42"));
-
- EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
- "http://www.google.com/search?q=something&espv="));
- EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
- "http://www.google.com/search?q=something&espv=0"));
- EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
- "http://www.google.com/search?q=something&espv=00"));
-
- EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
- "http://www.foo.com/search?q=something&espv=0"));
- EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
- "http://www.foo.com/search?q=something&espv=1"));
- EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
- "http://www.google.com/bing?q=something&espv=1"));
- EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
- "http://www.google.com/search?q=something&vespv=1"));
- EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
- "http://www.google.com/search?q=something&espvx=1"));
- EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
- "http://www.google.com/search#q=something&espv=1"));
-}
-
TEST(GoogleUtilTest, GoogleDomains) {
// Test some good Google domains (valid TLDs).
EXPECT_TRUE(IsGoogleDomainUrl("http://www.google.com",