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

Side by Side Diff: chrome/installer/util/google_chrome_distribution.h

Issue 10246007: Fix GetAppShortcutName to return a localized name for Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: string16 madness Created 8 years, 7 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 // This file extends generic BrowserDistribution class to declare Google Chrome 5 // This file extends generic BrowserDistribution class to declare Google Chrome
6 // specific implementation. 6 // specific implementation.
7 7
8 #ifndef CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_ 8 #ifndef CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_
9 #define CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_ 9 #define CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_
10 #pragma once 10 #pragma once
11 11
12 #include <string> 12 #include <string>
grt (UTC plus 2) 2012/04/27 18:23:07 remove this
gab 2012/04/27 20:58:45 Done.
13 13
14 #include "base/gtest_prod_util.h" 14 #include "base/gtest_prod_util.h"
15 #include "base/string16.h"
15 #include "chrome/installer/util/browser_distribution.h" 16 #include "chrome/installer/util/browser_distribution.h"
16 #include "chrome/installer/util/util_constants.h" 17 #include "chrome/installer/util/util_constants.h"
17 18
18 class FilePath; 19 class FilePath;
19 20
20 namespace base { 21 namespace base {
21 class DictionaryValue; 22 class DictionaryValue;
22 } 23 }
23 24
24 class GoogleChromeDistribution : public BrowserDistribution { 25 class GoogleChromeDistribution : public BrowserDistribution {
25 public: 26 public:
26 // Opens the Google Chrome uninstall survey window. 27 // Opens the Google Chrome uninstall survey window.
27 // version refers to the version of Chrome being uninstalled. 28 // version refers to the version of Chrome being uninstalled.
28 // local_data_path is the path of the file containing json metrics that 29 // local_data_path is the path of the file containing json metrics that
29 // will be parsed. If this file indicates that the user has opted in to 30 // will be parsed. If this file indicates that the user has opted in to
30 // providing anonymous usage data, then some additional statistics will 31 // providing anonymous usage data, then some additional statistics will
31 // be added to the survey url. 32 // be added to the survey url.
32 // distribution_data contains Google Update related data that will be 33 // distribution_data contains Google Update related data that will be
33 // concatenated to the survey url if the file in local_data_path indicates 34 // concatenated to the survey url if the file in local_data_path indicates
34 // the user has opted in to providing anonymous usage data. 35 // the user has opted in to providing anonymous usage data.
35 virtual void DoPostUninstallOperations( 36 virtual void DoPostUninstallOperations(
36 const Version& version, 37 const Version& version,
37 const FilePath& local_data_path, 38 const FilePath& local_data_path,
38 const std::wstring& distribution_data) OVERRIDE; 39 const string16& distribution_data) OVERRIDE;
39 40
40 virtual std::wstring GetAppGuid() OVERRIDE; 41 virtual string16 GetAppGuid() OVERRIDE;
41 42
42 virtual std::wstring GetApplicationName() OVERRIDE; 43 virtual string16 GetApplicationName() OVERRIDE;
43 44
44 virtual std::wstring GetAlternateApplicationName() OVERRIDE; 45 virtual string16 GetAppShortCutName() OVERRIDE;
45 46
46 virtual std::wstring GetBrowserAppId() OVERRIDE; 47 virtual string16 GetAlternateApplicationName() OVERRIDE;
47 48
48 virtual std::wstring GetInstallSubDir() OVERRIDE; 49 virtual string16 GetBrowserAppId() OVERRIDE;
49 50
50 virtual std::wstring GetPublisherName() OVERRIDE; 51 virtual string16 GetInstallSubDir() OVERRIDE;
51 52
52 virtual std::wstring GetAppDescription() OVERRIDE; 53 virtual string16 GetPublisherName() OVERRIDE;
54
55 virtual string16 GetAppDescription() OVERRIDE;
53 56
54 virtual std::string GetSafeBrowsingName() OVERRIDE; 57 virtual std::string GetSafeBrowsingName() OVERRIDE;
55 58
56 virtual std::wstring GetStateKey() OVERRIDE; 59 virtual string16 GetStateKey() OVERRIDE;
57 60
58 virtual std::wstring GetStateMediumKey() OVERRIDE; 61 virtual string16 GetStateMediumKey() OVERRIDE;
59 62
60 virtual std::wstring GetStatsServerURL() OVERRIDE; 63 virtual string16 GetStatsServerURL() OVERRIDE;
61 64
62 virtual std::string GetNetworkStatsServer() const OVERRIDE; 65 virtual std::string GetNetworkStatsServer() const OVERRIDE;
63 66
64 virtual std::string GetHttpPipeliningTestServer() const OVERRIDE; 67 virtual std::string GetHttpPipeliningTestServer() const OVERRIDE;
65 68
66 // This method reads data from the Google Update ClientState key for 69 // This method reads data from the Google Update ClientState key for
67 // potential use in the uninstall survey. It must be called before the 70 // potential use in the uninstall survey. It must be called before the
68 // key returned by GetVersionKey() is deleted. 71 // key returned by GetVersionKey() is deleted.
69 virtual std::wstring GetDistributionData(HKEY root_key) OVERRIDE; 72 virtual string16 GetDistributionData(HKEY root_key) OVERRIDE;
70 73
71 virtual std::wstring GetUninstallLinkName() OVERRIDE; 74 virtual string16 GetUninstallLinkName() OVERRIDE;
72 75
73 virtual std::wstring GetUninstallRegPath() OVERRIDE; 76 virtual string16 GetUninstallRegPath() OVERRIDE;
74 77
75 virtual std::wstring GetVersionKey() OVERRIDE; 78 virtual string16 GetVersionKey() OVERRIDE;
76 79
77 virtual bool GetDelegateExecuteHandlerData(string16* handler_class_uuid, 80 virtual bool GetDelegateExecuteHandlerData(string16* handler_class_uuid,
78 string16* type_lib_uuid, 81 string16* type_lib_uuid,
79 string16* type_lib_version, 82 string16* type_lib_version,
80 string16* interface_uuid) OVERRIDE; 83 string16* interface_uuid) OVERRIDE;
81 84
82 virtual void UpdateInstallStatus( 85 virtual void UpdateInstallStatus(
83 bool system_install, 86 bool system_install,
84 installer::ArchiveType archive_type, 87 installer::ArchiveType archive_type,
85 installer::InstallStatus install_status) OVERRIDE; 88 installer::InstallStatus install_status) OVERRIDE;
86 89
87 virtual bool GetExperimentDetails(UserExperiment* experiment, 90 virtual bool GetExperimentDetails(UserExperiment* experiment,
88 int flavor) OVERRIDE; 91 int flavor) OVERRIDE;
89 92
90 virtual void LaunchUserExperiment( 93 virtual void LaunchUserExperiment(
91 const FilePath& setup_path, 94 const FilePath& setup_path,
92 installer::InstallStatus status, 95 installer::InstallStatus status,
93 const Version& version, 96 const Version& version,
94 const installer::Product& product, 97 const installer::Product& product,
95 bool system_level) OVERRIDE; 98 bool system_level) OVERRIDE;
96 99
97 // Assuming that the user qualifies, this function performs the inactive user 100 // Assuming that the user qualifies, this function performs the inactive user
98 // toast experiment. It will use chrome to show the UI and it will record the 101 // toast experiment. It will use chrome to show the UI and it will record the
99 // outcome in the registry. 102 // outcome in the registry.
100 virtual void InactiveUserToastExperiment( 103 virtual void InactiveUserToastExperiment(
101 int flavor, 104 int flavor,
102 const std::wstring& experiment_group, 105 const string16& experiment_group,
103 const installer::Product& installation, 106 const installer::Product& installation,
104 const FilePath& application_path) OVERRIDE; 107 const FilePath& application_path) OVERRIDE;
105 108
106 const std::wstring& product_guid() { return product_guid_; } 109 const string16& product_guid() { return product_guid_; }
107 110
108 protected: 111 protected:
109 void set_product_guid(const std::wstring& guid) { product_guid_ = guid; } 112 void set_product_guid(const string16& guid) { product_guid_ = guid; }
110 113
111 // Disallow construction from others. 114 // Disallow construction from others.
112 GoogleChromeDistribution(); 115 GoogleChromeDistribution();
113 116
114 private: 117 private:
115 friend class BrowserDistribution; 118 friend class BrowserDistribution;
116 119
117 FRIEND_TEST_ALL_PREFIXES(GoogleChromeDistTest, TestExtractUninstallMetrics); 120 FRIEND_TEST_ALL_PREFIXES(GoogleChromeDistTest, TestExtractUninstallMetrics);
118 121
119 // Extracts uninstall metrics from the JSON file located at file_path. 122 // Extracts uninstall metrics from the JSON file located at file_path.
120 // Returns them in a form suitable for appending to a url that already 123 // Returns them in a form suitable for appending to a url that already
121 // has GET parameters, i.e. &metric1=foo&metric2=bar. 124 // has GET parameters, i.e. &metric1=foo&metric2=bar.
122 // Returns true if uninstall_metrics has been successfully populated with 125 // Returns true if uninstall_metrics has been successfully populated with
123 // the uninstall metrics, false otherwise. 126 // the uninstall metrics, false otherwise.
124 virtual bool ExtractUninstallMetricsFromFile( 127 virtual bool ExtractUninstallMetricsFromFile(
125 const FilePath& file_path, std::wstring* uninstall_metrics); 128 const FilePath& file_path, string16* uninstall_metrics);
126 129
127 // Extracts uninstall metrics from the given JSON value. 130 // Extracts uninstall metrics from the given JSON value.
128 virtual bool ExtractUninstallMetrics(const base::DictionaryValue& root, 131 virtual bool ExtractUninstallMetrics(const base::DictionaryValue& root,
129 std::wstring* uninstall_metrics); 132 string16* uninstall_metrics);
130 133
131 // Given a DictionaryValue containing a set of uninstall metrics, 134 // Given a DictionaryValue containing a set of uninstall metrics,
132 // this builds a URL parameter list of all the contained metrics. 135 // this builds a URL parameter list of all the contained metrics.
133 // Returns true if at least one uninstall metric was found in 136 // Returns true if at least one uninstall metric was found in
134 // uninstall_metrics_dict, false otherwise. 137 // uninstall_metrics_dict, false otherwise.
135 virtual bool BuildUninstallMetricsString( 138 virtual bool BuildUninstallMetricsString(
136 base::DictionaryValue* uninstall_metrics_dict, std::wstring* metrics); 139 base::DictionaryValue* uninstall_metrics_dict, string16* metrics);
137 140
138 // The product ID for Google Update. 141 // The product ID for Google Update.
139 std::wstring product_guid_; 142 string16 product_guid_;
140 }; 143 };
141 144
142 #endif // CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_ 145 #endif // CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698