summaryrefslogtreecommitdiffstats
path: root/chrome/browser/google_url_tracker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/google_url_tracker.cc')
-rw-r--r--chrome/browser/google_url_tracker.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome/browser/google_url_tracker.cc b/chrome/browser/google_url_tracker.cc
index a4428c3..2dc32e1 100644
--- a/chrome/browser/google_url_tracker.cc
+++ b/chrome/browser/google_url_tracker.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -79,14 +79,22 @@ bool GoogleURLTracker::CheckAndConvertToGoogleBaseURL(const GURL& url,
SplitStringDontTrim(url.host(), '.', &host_components);
if (host_components.size() < 2)
return false;
- std::string& component = host_components[host_components.size() - 2];
+ size_t google_component = host_components.size() - 2;
+ const std::string& component = host_components[google_component];
if (component != "google") {
if ((host_components.size() < 3) ||
((component != "co") && (component != "com")))
return false;
- if (host_components[host_components.size() - 3] != "google")
+ google_component = host_components.size() - 3;
+ if (host_components[google_component] != "google")
return false;
}
+ // For Google employees only: If the URL appears to be on
+ // [*.]corp.google.com, it's likely a doorway (e.g.
+ // wifi.corp.google.com), so ignore it.
+ if ((google_component > 0) &&
+ (host_components[google_component - 1] == "corp"))
+ return false;
// If the url's path does not begin "/intl/", reset it to "/". Other paths
// represent services such as iGoogle that are irrelevant to the baseURL.