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

Side by Side Diff: chrome/browser/metrics/antivirus_metrics_provider_win.h

Issue 2645473003: Merge M56:Trim AV names. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/metrics/antivirus_metrics_provider_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/antivirus_metrics_provider_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698