OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_INSTALLER_UTIL_SCOPED_USER_PROTOCOL_ENTRY_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_SCOPED_USER_PROTOCOL_ENTRY_H_ |
6 #define CHROME_INSTALLER_UTIL_SCOPED_USER_PROTOCOL_ENTRY_H_ | 6 #define CHROME_INSTALLER_UTIL_SCOPED_USER_PROTOCOL_ENTRY_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 | 12 |
13 class RegistryEntry; | 13 class RegistryEntry; |
14 | 14 |
15 // Windows 8 shows the "No apps are installed to open this type of link" | 15 // Windows 8 shows the "No apps are installed to open this type of link" |
16 // dialog when choosing a default handler for a |protocol| under certain | 16 // dialog when choosing a default handler for a |protocol| under certain |
17 // circumstances. Under these circumstances, it appears that ensuring the | 17 // circumstances. Under these circumstances, it appears that ensuring the |
18 // existance of the HKCU\Software\Classes\<protocol> key with an empty "URL | 18 // existence of the HKCU\Software\Classes\<protocol> key with an empty "URL |
19 // Protocol" value is sufficient to make the dialog contain the usual list of | 19 // Protocol" value is sufficient to make the dialog contain the usual list of |
20 // registered browsers. This class creates this key and value in its constructor | 20 // registered browsers. This class creates this key and value in its constructor |
21 // if needed, and cleans them up in its destructor if no other values or subkeys | 21 // if needed, and cleans them up in its destructor if no other values or subkeys |
22 // were created in the meantime. For details, see https://crbug.com/569151. | 22 // were created in the meantime. For details, see https://crbug.com/569151. |
23 class ScopedUserProtocolEntry { | 23 class ScopedUserProtocolEntry { |
24 public: | 24 public: |
25 explicit ScopedUserProtocolEntry(const wchar_t* protocol); | 25 explicit ScopedUserProtocolEntry(const wchar_t* protocol); |
26 ~ScopedUserProtocolEntry(); | 26 ~ScopedUserProtocolEntry(); |
27 | 27 |
28 private: | 28 private: |
29 std::vector<std::unique_ptr<RegistryEntry>> entries_; | 29 std::vector<std::unique_ptr<RegistryEntry>> entries_; |
30 | 30 |
31 DISALLOW_COPY_AND_ASSIGN(ScopedUserProtocolEntry); | 31 DISALLOW_COPY_AND_ASSIGN(ScopedUserProtocolEntry); |
32 }; | 32 }; |
33 | 33 |
34 #endif // CHROME_INSTALLER_UTIL_SCOPED_USER_PROTOCOL_ENTRY_H_ | 34 #endif // CHROME_INSTALLER_UTIL_SCOPED_USER_PROTOCOL_ENTRY_H_ |
OLD | NEW |