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

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

Issue 137623011: Switch to using the new Link Doctor API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Simulate click on more button Created 6 years, 10 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
32 // Adds the Google locale string to the URL (e.g., hl=en-US). This does not 36 // Adds the Google locale string to the URL (e.g., hl=en-US). This does not
33 // check to see if the param already exists. 37 // check to see if the param already exists.
34 GURL AppendGoogleLocaleParam(const GURL& url); 38 GURL AppendGoogleLocaleParam(const GURL& url);
35 39
36 // String version of AppendGoogleLocaleParam. 40 // String version of AppendGoogleLocaleParam.
37 std::string StringAppendGoogleLocaleParam(const std::string& url); 41 std::string StringAppendGoogleLocaleParam(const std::string& url);
38 42
39 // Adds the Google TLD string for the given profile to the URL (e.g., sd=com). 43 // Returns the Google country code string for the given profile.
40 // This does not check to see if the param already exists. 44 std::string GetGoogleCountryCodeCode(Profile* profile);
Peter Kasting 2014/02/04 22:49:04 "Code" is repeated twice.
mmenke 2014/02/04 23:52:02 Fixed.
41 GURL AppendGoogleTLDParam(Profile* profile, const GURL& url); 45
46 // Returns the Google search URL for the given profile.
47 GURL GetGoogleSearchURL(Profile* profile);
42 48
43 // Returns in |brand| the brand code or distribution tag that has been 49 // Returns in |brand| the brand code or distribution tag that has been
44 // assigned to a partner. Returns false if the information is not available. 50 // assigned to a partner. Returns false if the information is not available.
45 bool GetBrand(std::string* brand); 51 bool GetBrand(std::string* brand);
46 52
47 // Returns in |brand| the reactivation brand code or distribution tag 53 // Returns in |brand| the reactivation brand code or distribution tag
48 // that has been assigned to a partner for reactivating a dormant chrome 54 // that has been assigned to a partner for reactivating a dormant chrome
49 // install. Returns false if the information is not available. 55 // install. Returns false if the information is not available.
50 bool GetReactivationBrand(std::string* brand); 56 bool GetReactivationBrand(std::string* brand);
51 57
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 ~BrandForTesting(); 128 ~BrandForTesting();
123 129
124 private: 130 private:
125 std::string brand_; 131 std::string brand_;
126 DISALLOW_COPY_AND_ASSIGN(BrandForTesting); 132 DISALLOW_COPY_AND_ASSIGN(BrandForTesting);
127 }; 133 };
128 134
129 } // namespace google_util 135 } // namespace google_util
130 136
131 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ 137 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698