Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: chrome/browser/google_util.cc

Issue 174179: Mock the LinkDoctor for tests. Should greatly decrease ErrorPage test flakiness. (Closed)
Patch Set: sync with trunk Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/google_util.h ('k') | chrome/browser/net/url_request_mock_link_doctor_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/google_util.h ('k') | chrome/browser/net/url_request_mock_link_doctor_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698