OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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_FILE_ASSOCIATIONS_WIN_H_ |
| 6 #define CHROME_BROWSER_FILE_ASSOCIATIONS_WIN_H_ |
| 7 |
| 8 #include <set> |
| 9 #include <string> |
| 10 |
| 11 // This module is for manipulating per-user Windows file associations from an |
| 12 // unprivileged process (ie, Chrome itself). For the code that establishes the |
| 13 // machine-level associations during the Chrome installer, see |
| 14 // chrome/installer/util/shell_util.h. |
| 15 |
| 16 namespace base { |
| 17 class CommandLine; |
| 18 class FilePath; |
| 19 } |
| 20 |
| 21 // Associates a set of file extensions with a particular application in the |
| 22 // Windows registry, for the current user only. If an extension has no existing |
| 23 // default association, the given application becomes the default. Otherwise, |
| 24 // the application is added to the Open With menu for this type, but does not |
| 25 // become the default. |
| 26 // |
| 27 // |progid| is the unique internal name Windows will use for file associations |
| 28 // with this application. |
| 29 // |command_line| is the command to execute when opening a file via this |
| 30 // association. It should contain "%1" to pass the filename as an argument. |
| 31 // |file_type_name| and |icon_path| are the friendly name, and the path of the |
| 32 // icon, respectively, that will be used for files of these types when |
| 33 // associated with this application by default. (They are NOT the name/icon that |
| 34 // will represent the application under the Open With menu.) |
| 35 // Returns true on success; otherwise logs to stderr and returns false. |
| 36 bool AddWindowsFileAssociations(const std::string& progid, |
| 37 const base::CommandLine& command_line, |
| 38 const std::string& file_type_name, |
| 39 const base::FilePath& icon_path, |
| 40 const std::set<std::string>& file_extensions); |
| 41 |
| 42 // Deletes all associations with a particular application in the Windows |
| 43 // registry, for the current user only. |
| 44 // |progid| is the unique internal name Windows uses for file associations with |
| 45 // this application, as given to AddWindowsFileAssociations. All information |
| 46 // associated with this name will be deleted. |
| 47 bool DeleteWindowsFileAssociations(const std::string& progid); |
| 48 |
| 49 #endif // CHROME_BROWSER_FILE_ASSOCIATIONS_WIN_H_ |
OLD | NEW |