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

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

Issue 8728004: Add more flexible handling of what is considered a google home page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Address review comments, PSO checks for good/bad URLs Created 9 years 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/browser/chrome_browser_main.cc ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 20 matching lines...) Expand all
31 31
32 // Returns in |brand| the brand code or distribution tag that has been 32 // Returns in |brand| the brand code or distribution tag that has been
33 // assigned to a partner. Returns false if the information is not available. 33 // assigned to a partner. Returns false if the information is not available.
34 bool GetBrand(std::string* brand); 34 bool GetBrand(std::string* brand);
35 35
36 // Returns in |brand| the reactivation brand code or distribution tag 36 // Returns in |brand| the reactivation brand code or distribution tag
37 // that has been assigned to a partner for reactivating a dormant chrome 37 // that has been assigned to a partner for reactivating a dormant chrome
38 // install. Returns false if the information is not available. 38 // install. Returns false if the information is not available.
39 bool GetReactivationBrand(std::string* brand); 39 bool GetReactivationBrand(std::string* brand);
40 40
41 // True if |url| represents a valid Google home page URL.
42 bool IsGoogleHomePageUrl(const std::string& url);
43
41 // True if a build is strictly organic, according to its brand code. 44 // True if a build is strictly organic, according to its brand code.
42 bool IsOrganic(const std::string& brand); 45 bool IsOrganic(const std::string& brand);
43 46
44 // True if a build should run as organic during first run. This uses 47 // True if a build should run as organic during first run. This uses
45 // a slightly different set of brand codes from the standard IsOrganic 48 // a slightly different set of brand codes from the standard IsOrganic
46 // method. 49 // method.
47 bool IsOrganicFirstRun(const std::string& brand); 50 bool IsOrganicFirstRun(const std::string& brand);
48 51
49 // True if |brand| is an internet cafe brand code. 52 // True if |brand| is an internet cafe brand code.
50 bool IsInternetCafeBrandCode(const std::string& brand); 53 bool IsInternetCafeBrandCode(const std::string& brand);
51 54
52 // This class is meant to be used only from test code, and sets the brand 55 // This class is meant to be used only from test code, and sets the brand
53 // code returned by the function GetBrand() above while the object exists. 56 // code returned by the function GetBrand() above while the object exists.
54 class BrandForTesting { 57 class BrandForTesting {
55 public: 58 public:
56 explicit BrandForTesting(const std::string& brand); 59 explicit BrandForTesting(const std::string& brand);
57 ~BrandForTesting(); 60 ~BrandForTesting();
58 61
59 private: 62 private:
60 std::string brand_; 63 std::string brand_;
61 DISALLOW_COPY_AND_ASSIGN(BrandForTesting); 64 DISALLOW_COPY_AND_ASSIGN(BrandForTesting);
62 }; 65 };
63 66
64 } // namespace google_util 67 } // namespace google_util
65 68
66 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__ 69 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/google/google_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698