OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/google/google_util.h" | 5 #include "chrome/browser/google/google_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
17 #include "chrome/common/net/url_fixer_upper.h" | 17 #include "chrome/common/net/url_fixer_upper.h" |
18 #include "components/google/core/browser/google_switches.h" | 18 #include "components/google/core/browser/google_switches.h" |
| 19 #include "components/google/core/browser/google_url_tracker.h" |
19 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 20 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
20 #include "net/base/url_util.h" | 21 #include "net/base/url_util.h" |
21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
22 | 23 |
23 // Only use Link Doctor on official builds. It uses an API key, too, but | 24 // Only use Link Doctor on official builds. It uses an API key, too, but |
24 // seems best to just disable it, for more responsive error pages and to reduce | 25 // seems best to just disable it, for more responsive error pages and to reduce |
25 // server load. | 26 // server load. |
26 #if defined(GOOGLE_CHROME_BUILD) | 27 #if defined(GOOGLE_CHROME_BUILD) |
27 #define LINKDOCTOR_SERVER_REQUEST_URL "https://www.googleapis.com/rpc" | 28 #define LINKDOCTOR_SERVER_REQUEST_URL "https://www.googleapis.com/rpc" |
28 #else | 29 #else |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 if (!is_home_page_base && (path != "/search")) | 192 if (!is_home_page_base && (path != "/search")) |
192 return false; | 193 return false; |
193 | 194 |
194 // Check for query parameter in URL parameter and hash fragment, depending on | 195 // Check for query parameter in URL parameter and hash fragment, depending on |
195 // the path type. | 196 // the path type. |
196 return HasGoogleSearchQueryParam(url.ref()) || | 197 return HasGoogleSearchQueryParam(url.ref()) || |
197 (!is_home_page_base && HasGoogleSearchQueryParam(url.query())); | 198 (!is_home_page_base && HasGoogleSearchQueryParam(url.query())); |
198 } | 199 } |
199 | 200 |
200 } // namespace google_util | 201 } // namespace google_util |
OLD | NEW |