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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 RESULT_WSC_NOT_AVAILABLE = 15, | 65 RESULT_WSC_NOT_AVAILABLE = 15, |
66 RESULT_COUNT = 16 | 66 RESULT_COUNT = 16 |
67 }; | 67 }; |
68 | 68 |
69 typedef metrics::SystemProfileProto::AntiVirusProduct AvProduct; | 69 typedef metrics::SystemProfileProto::AntiVirusProduct AvProduct; |
70 | 70 |
71 // Query COM interface IWSCProductList for installed AV products. This | 71 // Query COM interface IWSCProductList for installed AV products. This |
72 // interface is only available on Windows 8 and above. | 72 // interface is only available on Windows 8 and above. |
73 static ResultCode FillAntiVirusProductsFromWSC( | 73 static ResultCode FillAntiVirusProductsFromWSC( |
74 std::vector<AvProduct>* products); | 74 std::vector<AvProduct>* products); |
75 | |
75 // Query WMI ROOT\SecurityCenter2 for installed AV products. This interface is | 76 // Query WMI ROOT\SecurityCenter2 for installed AV products. This interface is |
76 // only available on Windows Vista and above. | 77 // only available on Windows Vista and above. |
77 static ResultCode FillAntiVirusProductsFromWMI( | 78 static ResultCode FillAntiVirusProductsFromWMI( |
78 std::vector<AvProduct>* products); | 79 std::vector<AvProduct>* products); |
80 | |
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. | |
83 static void MaybeAddUnregisteredAntiVirusProducts( | |
rkaplow
2016/12/14 20:51:33
nit - would be consistant in naming between fill a
| |
84 std::vector<AvProduct>* products); | |
85 | |
79 static std::vector<AvProduct> GetAntiVirusProductsOnFileThread(); | 86 static std::vector<AvProduct> GetAntiVirusProductsOnFileThread(); |
80 | 87 |
81 // Called when metrics are done being gathered from the FILE thread. | 88 // Called when metrics are done being gathered from the FILE thread. |
82 // |done_callback| is the callback that should be called once all metrics are | 89 // |done_callback| is the callback that should be called once all metrics are |
83 // gathered. | 90 // gathered. |
84 void GotAntiVirusProducts(const base::Closure& done_callback, | 91 void GotAntiVirusProducts(const base::Closure& done_callback, |
85 const std::vector<AvProduct>& av_products); | 92 const std::vector<AvProduct>& av_products); |
86 | 93 |
87 // The TaskRunner on which file operations are performed (supplied by the | 94 // The TaskRunner on which file operations are performed (supplied by the |
88 // embedder). | 95 // embedder). |
89 scoped_refptr<base::TaskRunner> task_runner_; | 96 scoped_refptr<base::TaskRunner> task_runner_; |
90 | 97 |
91 // Information on installed AntiVirus gathered. | 98 // Information on installed AntiVirus gathered. |
92 std::vector<AvProduct> av_products_; | 99 std::vector<AvProduct> av_products_; |
93 | 100 |
94 base::ThreadChecker thread_checker_; | 101 base::ThreadChecker thread_checker_; |
95 base::WeakPtrFactory<AntiVirusMetricsProvider> weak_ptr_factory_; | 102 base::WeakPtrFactory<AntiVirusMetricsProvider> weak_ptr_factory_; |
96 | 103 |
97 FRIEND_TEST_ALL_PREFIXES(AntiVirusMetricsProviderTest, GetMetricsFullName); | 104 FRIEND_TEST_ALL_PREFIXES(AntiVirusMetricsProviderTest, GetMetricsFullName); |
98 | 105 |
99 DISALLOW_COPY_AND_ASSIGN(AntiVirusMetricsProvider); | 106 DISALLOW_COPY_AND_ASSIGN(AntiVirusMetricsProvider); |
100 }; | 107 }; |
101 | 108 |
102 #endif // CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_ | 109 #endif // CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_ |
OLD | NEW |