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

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

Issue 10644002: Add core plumbing for Instant Extended work (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address pkasting, tfarina, and remaining nits. Created 8 years, 6 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 | « no previous file | 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 #pragma once 9 #pragma once
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // "*.google.<TLD>" instead. 59 // "*.google.<TLD>" instead.
60 bool IsGoogleDomainUrl(const std::string& url, SubdomainPermission permission); 60 bool IsGoogleDomainUrl(const std::string& url, SubdomainPermission permission);
61 // True if |host| is "[www.]google.<TLD>" with a valid TLD. If 61 // True if |host| is "[www.]google.<TLD>" with a valid TLD. If
62 // |permission| is ALLOW_SUBDOMAIN, we check against host "*.google.<TLD>" 62 // |permission| is ALLOW_SUBDOMAIN, we check against host "*.google.<TLD>"
63 // instead. 63 // instead.
64 bool IsGoogleHostname(const std::string& host, SubdomainPermission permission); 64 bool IsGoogleHostname(const std::string& host, SubdomainPermission permission);
65 // True if |url| represents a valid Google home page URL. 65 // True if |url| represents a valid Google home page URL.
66 bool IsGoogleHomePageUrl(const std::string& url); 66 bool IsGoogleHomePageUrl(const std::string& url);
67 // True if |url| represents a valid Google search URL. 67 // True if |url| represents a valid Google search URL.
68 bool IsGoogleSearchUrl(const std::string& url); 68 bool IsGoogleSearchUrl(const std::string& url);
69 // True if |url| represents a valid Google search URL used by the Instant
70 // Extended API.
71 bool IsInstantExtendedAPIGoogleSearchUrl(const std::string& url);
69 72
70 // True if a build is strictly organic, according to its brand code. 73 // True if a build is strictly organic, according to its brand code.
71 bool IsOrganic(const std::string& brand); 74 bool IsOrganic(const std::string& brand);
72 75
73 // True if a build should run as organic during first run. This uses 76 // True if a build should run as organic during first run. This uses
74 // a slightly different set of brand codes from the standard IsOrganic 77 // a slightly different set of brand codes from the standard IsOrganic
75 // method. 78 // method.
76 bool IsOrganicFirstRun(const std::string& brand); 79 bool IsOrganicFirstRun(const std::string& brand);
77 80
78 // True if |brand| is an internet cafe brand code. 81 // True if |brand| is an internet cafe brand code.
79 bool IsInternetCafeBrandCode(const std::string& brand); 82 bool IsInternetCafeBrandCode(const std::string& brand);
80 83
81 // This class is meant to be used only from test code, and sets the brand 84 // This class is meant to be used only from test code, and sets the brand
82 // code returned by the function GetBrand() above while the object exists. 85 // code returned by the function GetBrand() above while the object exists.
83 class BrandForTesting { 86 class BrandForTesting {
84 public: 87 public:
85 explicit BrandForTesting(const std::string& brand); 88 explicit BrandForTesting(const std::string& brand);
86 ~BrandForTesting(); 89 ~BrandForTesting();
87 90
88 private: 91 private:
89 std::string brand_; 92 std::string brand_;
90 DISALLOW_COPY_AND_ASSIGN(BrandForTesting); 93 DISALLOW_COPY_AND_ASSIGN(BrandForTesting);
91 }; 94 };
92 95
93 } // namespace google_util 96 } // namespace google_util
94 97
95 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ 98 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/google/google_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698