OLD | NEW |
1 // Copyright (c) 2006-2009 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 DictionaryValue; | 18 class DictionaryValue; |
| 19 class FilePath; |
19 | 20 |
20 class GoogleChromeDistribution : public BrowserDistribution { | 21 class GoogleChromeDistribution : public BrowserDistribution { |
21 public: | 22 public: |
22 // Opens the Google Chrome uninstall survey window. | 23 // Opens the Google Chrome uninstall survey window. |
23 // version refers to the version of Chrome being uninstalled. | 24 // version refers to the version of Chrome being uninstalled. |
24 // local_data_path is the path of the file containing json metrics that | 25 // local_data_path is the path of the file containing json metrics that |
25 // will be parsed. If this file indicates that the user has opted in to | 26 // will be parsed. If this file indicates that the user has opted in to |
26 // providing anonymous usage data, then some additional statistics will | 27 // providing anonymous usage data, then some additional statistics will |
27 // be added to the survey url. | 28 // be added to the survey url. |
28 // distribution_data contains Google Update related data that will be | 29 // distribution_data contains Google Update related data that will be |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 friend class BrowserDistribution; | 96 friend class BrowserDistribution; |
96 | 97 |
97 FRIEND_TEST_ALL_PREFIXES(GoogleChromeDistTest, TestExtractUninstallMetrics); | 98 FRIEND_TEST_ALL_PREFIXES(GoogleChromeDistTest, TestExtractUninstallMetrics); |
98 | 99 |
99 // Extracts uninstall metrics from the JSON file located at file_path. | 100 // Extracts uninstall metrics from the JSON file located at file_path. |
100 // Returns them in a form suitable for appending to a url that already | 101 // Returns them in a form suitable for appending to a url that already |
101 // has GET parameters, i.e. &metric1=foo&metric2=bar. | 102 // has GET parameters, i.e. &metric1=foo&metric2=bar. |
102 // Returns true if uninstall_metrics has been successfully populated with | 103 // Returns true if uninstall_metrics has been successfully populated with |
103 // the uninstall metrics, false otherwise. | 104 // the uninstall metrics, false otherwise. |
104 virtual bool ExtractUninstallMetricsFromFile( | 105 virtual bool ExtractUninstallMetricsFromFile( |
105 const std::wstring& file_path, std::wstring* uninstall_metrics); | 106 const FilePath& file_path, std::wstring* uninstall_metrics); |
106 | 107 |
107 // Extracts uninstall metrics from the given JSON value. | 108 // Extracts uninstall metrics from the given JSON value. |
108 virtual bool ExtractUninstallMetrics(const DictionaryValue& root, | 109 virtual bool ExtractUninstallMetrics(const DictionaryValue& root, |
109 std::wstring* uninstall_metrics); | 110 std::wstring* uninstall_metrics); |
110 | 111 |
111 // Given a DictionaryValue containing a set of uninstall metrics, | 112 // Given a DictionaryValue containing a set of uninstall metrics, |
112 // this builds a URL parameter list of all the contained metrics. | 113 // this builds a URL parameter list of all the contained metrics. |
113 // Returns true if at least one uninstall metric was found in | 114 // Returns true if at least one uninstall metric was found in |
114 // uninstall_metrics_dict, false otherwise. | 115 // uninstall_metrics_dict, false otherwise. |
115 virtual bool BuildUninstallMetricsString( | 116 virtual bool BuildUninstallMetricsString( |
116 DictionaryValue* uninstall_metrics_dict, std::wstring* metrics); | 117 DictionaryValue* uninstall_metrics_dict, std::wstring* metrics); |
117 | 118 |
118 // The product ID for Google Update. | 119 // The product ID for Google Update. |
119 std::wstring product_guid_; | 120 std::wstring product_guid_; |
120 }; | 121 }; |
121 | 122 |
122 #endif // CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_ | 123 #endif // CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_ |
OLD | NEW |