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

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

Issue 10908226: Introduces a search term extraction mechanism working for arbitrary search providers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed version_46.sql, committed separately. Created 8 years, 2 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
« no previous file with comments | « chrome/app/policy/policy_templates.json ('k') | chrome/browser/google/google_util.cc » ('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) 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>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/string16.h"
14 13
15 class GURL; 14 class GURL;
16 class Profile; 15 class Profile;
17 16
18 // This namespace provides various helpers around handling Google-related URLs 17 // This namespace provides various helpers around handling Google-related URLs
19 // and state relating to Google Chrome distributions (such as RLZ). 18 // and state relating to Google Chrome distributions (such as RLZ).
20 namespace google_util { 19 namespace google_util {
21 20
22 // The query key that identifies a Google Extended API request for Instant. 21 // The query key that identifies a Google Extended API request for Instant.
23 const char kInstantExtendedAPIParam[] = "espv"; 22 const char kInstantExtendedAPIParam[] = "espv";
(...skipping 14 matching lines...) Expand all
38 37
39 // Returns in |brand| the brand code or distribution tag that has been 38 // Returns in |brand| the brand code or distribution tag that has been
40 // assigned to a partner. Returns false if the information is not available. 39 // assigned to a partner. Returns false if the information is not available.
41 bool GetBrand(std::string* brand); 40 bool GetBrand(std::string* brand);
42 41
43 // Returns in |brand| the reactivation brand code or distribution tag 42 // Returns in |brand| the reactivation brand code or distribution tag
44 // that has been assigned to a partner for reactivating a dormant chrome 43 // that has been assigned to a partner for reactivating a dormant chrome
45 // install. Returns false if the information is not available. 44 // install. Returns false if the information is not available.
46 bool GetReactivationBrand(std::string* brand); 45 bool GetReactivationBrand(std::string* brand);
47 46
48 // Returns in the search terms used to create the Google search URL |url|.
49 string16 GetSearchTermsFromGoogleSearchURL(const std::string& url);
50
51 // WARNING: The following IsGoogleXXX() functions use heuristics to rule out 47 // WARNING: The following IsGoogleXXX() functions use heuristics to rule out
52 // "obviously false" answers. They do NOT guarantee that the string in question 48 // "obviously false" answers. They do NOT guarantee that the string in question
53 // is actually on a Google-owned domain, just that it looks plausible. If you 49 // is actually on a Google-owned domain, just that it looks plausible. If you
54 // need to restrict some behavior to only happen on Google's officially-owned 50 // need to restrict some behavior to only happen on Google's officially-owned
55 // domains, use TransportSecurityState::IsGooglePinnedProperty() instead. 51 // domains, use TransportSecurityState::IsGooglePinnedProperty() instead.
56 52
57 // Designate whether or not a URL checking function also checks for specific 53 // Designate whether or not a URL checking function also checks for specific
58 // subdomains, or only "www" and empty subdomains. 54 // subdomains, or only "www" and empty subdomains.
59 enum SubdomainPermission { 55 enum SubdomainPermission {
60 ALLOW_SUBDOMAIN, 56 ALLOW_SUBDOMAIN,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 ~BrandForTesting(); 103 ~BrandForTesting();
108 104
109 private: 105 private:
110 std::string brand_; 106 std::string brand_;
111 DISALLOW_COPY_AND_ASSIGN(BrandForTesting); 107 DISALLOW_COPY_AND_ASSIGN(BrandForTesting);
112 }; 108 };
113 109
114 } // namespace google_util 110 } // namespace google_util
115 111
116 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ 112 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__
OLDNEW
« no previous file with comments | « chrome/app/policy/policy_templates.json ('k') | chrome/browser/google/google_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698