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

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

Issue 2854983002: Add the ThirdPartyModules.Uninstallable histogram. (Closed)
Patch Set: Created 3 years, 8 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/msi_util_win.h
diff --git a/chrome/browser/conflicts/msi_util_win.h b/chrome/browser/conflicts/msi_util_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..b8a8f3b341e7fb353ff19e617a1b2e4bfbd34f63
--- /dev/null
+++ b/chrome/browser/conflicts/msi_util_win.h
@@ -0,0 +1,35 @@
+// 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_MSI_UTIL_WIN_H_
+#define CHROME_BROWSER_CONFLICTS_MSI_UTIL_WIN_H_
+
+#include <vector>
+
+#include "base/callback.h"
+#include "base/strings/string16.h"
+
+// Using the Microsoft Installer API, retrieves the path of all the components
+// for a given product. This function should be called on a thread that allows
+// access to the file system. Returns false if any error occured, including if
+// the |product_guid| passed is not a GUID.
+//
+// Note: Since testing this function is not viable, it can be overriden via
+// OverrideGetMsiComponentPaths() to allow its used inside unit tests.
+bool GetMsiComponentPaths(const base::string16& product_guid,
+ std::vector<base::string16>* component_paths);
+
+using GetMsiComponentPathsOverride =
+ base::Callback<bool(const base::string16&, std::vector<base::string16>*)>;
+class ScopedGetMsiComponentPathsOverride {
+ public:
+ ScopedGetMsiComponentPathsOverride(
+ const GetMsiComponentPathsOverride& override);
+ ~ScopedGetMsiComponentPathsOverride();
+
+ private:
+ GetMsiComponentPathsOverride override_;
+};
chrisha 2017/05/02 21:28:25 I'm not a huge fan of this pattern as there's effe
Patrick Monette 2017/05/29 22:04:55 Done.
+
+#endif // CHROME_BROWSER_CONFLICTS_MSI_UTIL_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698