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

Unified Diff: chrome/browser/conflicts/third_party_metrics_recorder_win.h

Issue 2854983002: Add the ThirdPartyModules.Uninstallable histogram. (Closed)
Patch Set: Rebase Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/conflicts/third_party_metrics_recorder_win.h
diff --git a/chrome/browser/conflicts/third_party_metrics_recorder_win.h b/chrome/browser/conflicts/third_party_metrics_recorder_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..ef1eecdd0ea8c1e42e0d5cc4400f19f34e7b9688
--- /dev/null
+++ b/chrome/browser/conflicts/third_party_metrics_recorder_win.h
@@ -0,0 +1,38 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CONFLICTS_THIRD_PARTY_METRICS_RECORDER_WIN_H_
+#define CHROME_BROWSER_CONFLICTS_THIRD_PARTY_METRICS_RECORDER_WIN_H_
+
+#include "base/macros.h"
+#include "chrome/browser/conflicts/installed_programs_win.h"
+#include "chrome/browser/conflicts/module_database_observer_win.h"
+
+class ModuleDatabase;
+struct ModuleInfoData;
+struct ModuleInfoKey;
+
+// Records metrics about third party modules loaded into Chrome.
+class ThirdPartyMetricsRecorder : public ModuleDatabaseObserver {
+ public:
+ explicit ThirdPartyMetricsRecorder(ModuleDatabase* module_database);
+ ~ThirdPartyMetricsRecorder() override;
+
+ // ModuleDatabaseObserver:
+ void OnNewModuleFound(const ModuleInfoKey& module_key,
+ const ModuleInfoData& module_data) override;
+
+ private:
+ void OnInstalledProgramsInitialized(ModuleDatabase* module_database);
+
+ // Returns true if |module_data| is a third party module. Third party modules
+ // are defined as not being signed by Google or Microsoft.
+ bool IsThirdPartyModule(const ModuleInfoData& module_data);
+
+ InstalledPrograms installed_programs_;
+
+ DISALLOW_COPY_AND_ASSIGN(ThirdPartyMetricsRecorder);
+};
+
+#endif // CHROME_BROWSER_CONFLICTS_THIRD_PARTY_METRICS_RECORDER_WIN_H_
« no previous file with comments | « chrome/browser/conflicts/module_database_win.cc ('k') | chrome/browser/conflicts/third_party_metrics_recorder_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698