OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CONFLICTS_MSI_UTIL_WIN_H_ | |
6 #define CHROME_BROWSER_CONFLICTS_MSI_UTIL_WIN_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/callback.h" | |
11 #include "base/strings/string16.h" | |
12 | |
13 // Using the Microsoft Installer API, retrieves the path of all the components | |
14 // for a given product. This function should be called on a thread that allows | |
15 // access to the file system. Returns false if any error occured, including if | |
16 // the |product_guid| passed is not a GUID. | |
17 // | |
18 // Note: Since testing this function is not viable, it can be overriden via | |
19 // OverrideGetMsiComponentPaths() to allow its used inside unit tests. | |
20 bool GetMsiComponentPaths(const base::string16& product_guid, | |
21 std::vector<base::string16>* component_paths); | |
22 | |
23 using GetMsiComponentPathsOverride = | |
24 base::Callback<bool(const base::string16&, std::vector<base::string16>*)>; | |
25 class ScopedGetMsiComponentPathsOverride { | |
26 public: | |
27 ScopedGetMsiComponentPathsOverride( | |
28 const GetMsiComponentPathsOverride& override); | |
29 ~ScopedGetMsiComponentPathsOverride(); | |
30 | |
31 private: | |
32 GetMsiComponentPathsOverride override_; | |
33 }; | |
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.
| |
34 | |
35 #endif // CHROME_BROWSER_CONFLICTS_MSI_UTIL_WIN_H_ | |
OLD | NEW |