| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_util.h" | 5 #include "chrome/browser/google_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 query += param_name + "=" + param_value; | 24 query += param_name + "=" + param_value; |
| 25 GURL::Replacements repl; | 25 GURL::Replacements repl; |
| 26 repl.SetQueryStr(query); | 26 repl.SetQueryStr(query); |
| 27 return url.ReplaceComponents(repl); | 27 return url.ReplaceComponents(repl); |
| 28 } | 28 } |
| 29 | 29 |
| 30 } // anonymous namespace | 30 } // anonymous namespace |
| 31 | 31 |
| 32 namespace google_util { | 32 namespace google_util { |
| 33 | 33 |
| 34 const char kLinkDoctorBaseURL[] = |
| 35 "http://linkhelp.clients.google.com/tbproxy/lh/fixurl"; |
| 36 |
| 34 GURL AppendGoogleLocaleParam(const GURL& url) { | 37 GURL AppendGoogleLocaleParam(const GURL& url) { |
| 35 return AppendParam(url, "hl", | 38 return AppendParam(url, "hl", |
| 36 g_browser_process->GetApplicationLocale()); | 39 g_browser_process->GetApplicationLocale()); |
| 37 } | 40 } |
| 38 | 41 |
| 39 GURL AppendGoogleTLDParam(const GURL& url) { | 42 GURL AppendGoogleTLDParam(const GURL& url) { |
| 40 const std::string google_domain( | 43 const std::string google_domain( |
| 41 net::RegistryControlledDomainService::GetDomainAndRegistry( | 44 net::RegistryControlledDomainService::GetDomainAndRegistry( |
| 42 GoogleURLTracker::GoogleURL())); | 45 GoogleURLTracker::GoogleURL())); |
| 43 const size_t first_dot = google_domain.find('.'); | 46 const size_t first_dot = google_domain.find('.'); |
| 44 if (first_dot == std::string::npos) { | 47 if (first_dot == std::string::npos) { |
| 45 NOTREACHED(); | 48 NOTREACHED(); |
| 46 return url; | 49 return url; |
| 47 } | 50 } |
| 48 return AppendParam(url, "sd", google_domain.substr(first_dot + 1)); | 51 return AppendParam(url, "sd", google_domain.substr(first_dot + 1)); |
| 49 } | 52 } |
| 50 | 53 |
| 51 } // namespace google_util | 54 } // namespace google_util |
| OLD | NEW |