OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 module mojom; | 5 module mojom; |
6 | 6 |
| 7 import "mojo/common/common_custom_types.mojom"; |
| 8 |
| 9 [Native] |
| 10 struct FileExtensionFilters; |
| 11 |
7 interface ShellHandler { | 12 interface ShellHandler { |
8 // Returns the pinned state of the current executable. | 13 // Returns the pinned state of the current executable. |
9 IsPinnedToTaskbar() => (bool succeeded, bool is_pinned_to_taskbar); | 14 IsPinnedToTaskbar() => (bool succeeded, bool is_pinned_to_taskbar); |
10 }; | 15 |
| 16 // Invokes GetOpenFileName. |
| 17 // |owner| is the HWND to use as the parent of the modal dialog. |
| 18 // |flags| is the OFN_* flags of OPENFILENAME. |
| 19 // |filters| constrains the user's file choices. |
| 20 // |initial_directory| is the directory to be displayed. |
| 21 // |filename| is the file initially selected. |
| 22 // |
| 23 // Returns the list of selected |files|, which are all childs of |directory|. |
| 24 // On cancelation or failure, |files| will be empty. |
| 25 DoGetOpenFileName(uint64 owner, |
| 26 uint32 flags, |
| 27 FileExtensionFilters filters, |
| 28 mojo.common.mojom.FilePath initial_directory, |
| 29 mojo.common.mojom.FilePath filename) => |
| 30 (mojo.common.mojom.FilePath directory, |
| 31 array<mojo.common.mojom.FilePath> files); |
| 32 |
| 33 // Invokes GetSaveFileName. |
| 34 // |owner| is the HWND to use as the parent of the modal dialog. |
| 35 // |flags| is the OFN_* flags of OPENFILENAME. |
| 36 // |filters| constrains the user's file choices. |
| 37 // |one_based_filter_index| is The index of the currently selected filter in |
| 38 // |filters|. |
| 39 // |initial_directory| is the directory to be displayed. |
| 40 // |filename| is the file initially selected. |
| 41 // |default_extension| is the extension to add to the file if the user doesn't |
| 42 // type one. |
| 43 // |
| 44 // Returns the selected |path| and the |one_based_filter_index| of the filter |
| 45 // passed to the initial call to DoGetSaveFileName. On cancelation or failure, |
| 46 // |path| will be empty. |
| 47 DoGetSaveFileName(uint64 owner, |
| 48 uint32 flags, |
| 49 FileExtensionFilters filters, |
| 50 uint32 one_based_filter_index, |
| 51 mojo.common.mojom.FilePath initial_directory, |
| 52 mojo.common.mojom.FilePath suggested_filename, |
| 53 mojo.common.mojom.FilePath default_extension) => |
| 54 (mojo.common.mojom.FilePath path, uint32 one_based_filter_index); |
| 55 }; |
OLD | NEW |