| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_ | 5 #ifndef CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_ |
| 6 #define CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_ | 6 #define CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_ |
| 7 | 7 |
| 8 #include "components/metrics/metrics_provider.h" | 8 #include "components/metrics/metrics_provider.h" |
| 9 | 9 |
| 10 #include <iwscapi.h> | 10 #include <iwscapi.h> |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 static ResultCode FillAntiVirusProductsFromWMI( | 78 static ResultCode FillAntiVirusProductsFromWMI( |
| 79 std::vector<AvProduct>* products); | 79 std::vector<AvProduct>* products); |
| 80 | 80 |
| 81 // Query local machine configuration for other products that might not be | 81 // Query local machine configuration for other products that might not be |
| 82 // registered in WMI or Security Center and add them to the product vector. | 82 // registered in WMI or Security Center and add them to the product vector. |
| 83 static void MaybeAddUnregisteredAntiVirusProducts( | 83 static void MaybeAddUnregisteredAntiVirusProducts( |
| 84 std::vector<AvProduct>* products); | 84 std::vector<AvProduct>* products); |
| 85 | 85 |
| 86 static std::vector<AvProduct> GetAntiVirusProductsOnFileThread(); | 86 static std::vector<AvProduct> GetAntiVirusProductsOnFileThread(); |
| 87 | 87 |
| 88 // Removes anything extraneous from the end of the product name such as |
| 89 // versions, years, or anything containing numbers to make it more constant. |
| 90 static std::string TrimVersionOfAvProductName(const std::string& av_product); |
| 91 |
| 88 // Called when metrics are done being gathered from the FILE thread. | 92 // Called when metrics are done being gathered from the FILE thread. |
| 89 // |done_callback| is the callback that should be called once all metrics are | 93 // |done_callback| is the callback that should be called once all metrics are |
| 90 // gathered. | 94 // gathered. |
| 91 void GotAntiVirusProducts(const base::Closure& done_callback, | 95 void GotAntiVirusProducts(const base::Closure& done_callback, |
| 92 const std::vector<AvProduct>& av_products); | 96 const std::vector<AvProduct>& av_products); |
| 93 | 97 |
| 94 // The TaskRunner on which file operations are performed (supplied by the | 98 // The TaskRunner on which file operations are performed (supplied by the |
| 95 // embedder). | 99 // embedder). |
| 96 scoped_refptr<base::TaskRunner> task_runner_; | 100 scoped_refptr<base::TaskRunner> task_runner_; |
| 97 | 101 |
| 98 // Information on installed AntiVirus gathered. | 102 // Information on installed AntiVirus gathered. |
| 99 std::vector<AvProduct> av_products_; | 103 std::vector<AvProduct> av_products_; |
| 100 | 104 |
| 101 base::ThreadChecker thread_checker_; | 105 base::ThreadChecker thread_checker_; |
| 102 base::WeakPtrFactory<AntiVirusMetricsProvider> weak_ptr_factory_; | 106 base::WeakPtrFactory<AntiVirusMetricsProvider> weak_ptr_factory_; |
| 103 | 107 |
| 104 FRIEND_TEST_ALL_PREFIXES(AntiVirusMetricsProviderTest, GetMetricsFullName); | 108 FRIEND_TEST_ALL_PREFIXES(AntiVirusMetricsProviderTest, GetMetricsFullName); |
| 109 FRIEND_TEST_ALL_PREFIXES(AntiVirusMetricsProviderSimpleTest, |
| 110 StripProductVersion); |
| 105 | 111 |
| 106 DISALLOW_COPY_AND_ASSIGN(AntiVirusMetricsProvider); | 112 DISALLOW_COPY_AND_ASSIGN(AntiVirusMetricsProvider); |
| 107 }; | 113 }; |
| 108 | 114 |
| 109 #endif // CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_ | 115 #endif // CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_ |
| OLD | NEW |