OLD | NEW |
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 // 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> |
13 | 13 |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "chrome/installer/util/browser_distribution.h" | 15 #include "chrome/installer/util/browser_distribution.h" |
16 #include "chrome/installer/util/util_constants.h" | 16 #include "chrome/installer/util/util_constants.h" |
17 | 17 |
| 18 class FilePath; |
| 19 |
| 20 namespace base { |
18 class DictionaryValue; | 21 class DictionaryValue; |
19 class FilePath; | 22 } |
20 | 23 |
21 class GoogleChromeDistribution : public BrowserDistribution { | 24 class GoogleChromeDistribution : public BrowserDistribution { |
22 public: | 25 public: |
23 // Opens the Google Chrome uninstall survey window. | 26 // Opens the Google Chrome uninstall survey window. |
24 // version refers to the version of Chrome being uninstalled. | 27 // version refers to the version of Chrome being uninstalled. |
25 // local_data_path is the path of the file containing json metrics that | 28 // local_data_path is the path of the file containing json metrics that |
26 // will be parsed. If this file indicates that the user has opted in to | 29 // will be parsed. If this file indicates that the user has opted in to |
27 // providing anonymous usage data, then some additional statistics will | 30 // providing anonymous usage data, then some additional statistics will |
28 // be added to the survey url. | 31 // be added to the survey url. |
29 // distribution_data contains Google Update related data that will be | 32 // distribution_data contains Google Update related data that will be |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 111 |
109 // Extracts uninstall metrics from the JSON file located at file_path. | 112 // Extracts uninstall metrics from the JSON file located at file_path. |
110 // Returns them in a form suitable for appending to a url that already | 113 // Returns them in a form suitable for appending to a url that already |
111 // has GET parameters, i.e. &metric1=foo&metric2=bar. | 114 // has GET parameters, i.e. &metric1=foo&metric2=bar. |
112 // Returns true if uninstall_metrics has been successfully populated with | 115 // Returns true if uninstall_metrics has been successfully populated with |
113 // the uninstall metrics, false otherwise. | 116 // the uninstall metrics, false otherwise. |
114 virtual bool ExtractUninstallMetricsFromFile( | 117 virtual bool ExtractUninstallMetricsFromFile( |
115 const FilePath& file_path, std::wstring* uninstall_metrics); | 118 const FilePath& file_path, std::wstring* uninstall_metrics); |
116 | 119 |
117 // Extracts uninstall metrics from the given JSON value. | 120 // Extracts uninstall metrics from the given JSON value. |
118 virtual bool ExtractUninstallMetrics(const DictionaryValue& root, | 121 virtual bool ExtractUninstallMetrics(const base::DictionaryValue& root, |
119 std::wstring* uninstall_metrics); | 122 std::wstring* uninstall_metrics); |
120 | 123 |
121 // Given a DictionaryValue containing a set of uninstall metrics, | 124 // Given a DictionaryValue containing a set of uninstall metrics, |
122 // this builds a URL parameter list of all the contained metrics. | 125 // this builds a URL parameter list of all the contained metrics. |
123 // Returns true if at least one uninstall metric was found in | 126 // Returns true if at least one uninstall metric was found in |
124 // uninstall_metrics_dict, false otherwise. | 127 // uninstall_metrics_dict, false otherwise. |
125 virtual bool BuildUninstallMetricsString( | 128 virtual bool BuildUninstallMetricsString( |
126 DictionaryValue* uninstall_metrics_dict, std::wstring* metrics); | 129 base::DictionaryValue* uninstall_metrics_dict, std::wstring* metrics); |
127 | 130 |
128 // The product ID for Google Update. | 131 // The product ID for Google Update. |
129 std::wstring product_guid_; | 132 std::wstring product_guid_; |
130 }; | 133 }; |
131 | 134 |
132 #endif // CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_ | 135 #endif // CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_ |
OLD | NEW |