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

Side by Side Diff: trunk/src/chrome/browser/google/google_util.h

Issue 185003002: Revert 254207 "Switch to using the new Link Doctor API." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
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 // Some Google related utility functions. 5 // Some Google related utility functions.
6 6
7 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ 7 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__
8 #define CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ 8 #define CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__
9 9
10 #include <string> 10 #include <string>
(...skipping 11 matching lines...) Expand all
22 // |str| should be a query or a hash fragment, without the ? or # (as 22 // |str| should be a query or a hash fragment, without the ? or # (as
23 // returned by GURL::query() or GURL::ref(). 23 // returned by GURL::query() or GURL::ref().
24 bool HasGoogleSearchQueryParam(const std::string& str); 24 bool HasGoogleSearchQueryParam(const std::string& str);
25 25
26 // The query key that identifies a Google Extended API request for Instant. 26 // The query key that identifies a Google Extended API request for Instant.
27 const char kInstantExtendedAPIParam[] = "espv"; 27 const char kInstantExtendedAPIParam[] = "espv";
28 28
29 GURL LinkDoctorBaseURL(); 29 GURL LinkDoctorBaseURL();
30 void SetMockLinkDoctorBaseURLForTesting(); 30 void SetMockLinkDoctorBaseURLForTesting();
31 31
32 // Returns the Google locale. This is the same string as
33 // AppendGoogleLocaleParam adds to the URL, only without the leading "hl".
34 std::string GetGoogleLocale();
35
36 // Adds the Google locale string to the URL (e.g., hl=en-US). This does not 32 // Adds the Google locale string to the URL (e.g., hl=en-US). This does not
37 // check to see if the param already exists. 33 // check to see if the param already exists.
38 GURL AppendGoogleLocaleParam(const GURL& url); 34 GURL AppendGoogleLocaleParam(const GURL& url);
39 35
40 // String version of AppendGoogleLocaleParam. 36 // String version of AppendGoogleLocaleParam.
41 std::string StringAppendGoogleLocaleParam(const std::string& url); 37 std::string StringAppendGoogleLocaleParam(const std::string& url);
42 38
43 // Returns the Google country code string for the given profile. 39 // Adds the Google TLD string for the given profile to the URL (e.g., sd=com).
44 std::string GetGoogleCountryCode(Profile* profile); 40 // This does not check to see if the param already exists.
45 41 GURL AppendGoogleTLDParam(Profile* profile, const GURL& url);
46 // Returns the Google search URL for the given profile.
47 GURL GetGoogleSearchURL(Profile* profile);
48 42
49 // Returns in |brand| the brand code or distribution tag that has been 43 // Returns in |brand| the brand code or distribution tag that has been
50 // assigned to a partner. Returns false if the information is not available. 44 // assigned to a partner. Returns false if the information is not available.
51 bool GetBrand(std::string* brand); 45 bool GetBrand(std::string* brand);
52 46
53 // Returns in |brand| the reactivation brand code or distribution tag 47 // Returns in |brand| the reactivation brand code or distribution tag
54 // that has been assigned to a partner for reactivating a dormant chrome 48 // that has been assigned to a partner for reactivating a dormant chrome
55 // install. Returns false if the information is not available. 49 // install. Returns false if the information is not available.
56 bool GetReactivationBrand(std::string* brand); 50 bool GetReactivationBrand(std::string* brand);
57 51
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 ~BrandForTesting(); 122 ~BrandForTesting();
129 123
130 private: 124 private:
131 std::string brand_; 125 std::string brand_;
132 DISALLOW_COPY_AND_ASSIGN(BrandForTesting); 126 DISALLOW_COPY_AND_ASSIGN(BrandForTesting);
133 }; 127 };
134 128
135 } // namespace google_util 129 } // namespace google_util
136 130
137 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ 131 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/errorpage_browsertest.cc ('k') | trunk/src/chrome/browser/google/google_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698