file_chooser_params.h revision 7d4cd473f85ac64c3747c96c277f9e506a0d2246
1// Copyright (c) 2012 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 CONTENT_PUBLIC_COMMON_FILE_CHOOSER_PARAMS_H_
6#define CONTENT_PUBLIC_COMMON_FILE_CHOOSER_PARAMS_H_
7
8#include <vector>
9
10#include "base/files/file_path.h"
11#include "base/strings/string16.h"
12#include "content/common/content_export.h"
13
14namespace content {
15
16// Struct used by WebContentsDelegate.
17struct CONTENT_EXPORT FileChooserParams {
18  FileChooserParams();
19  ~FileChooserParams();
20
21  enum Mode {
22    // Requires that the file exists before allowing the user to pick it.
23    Open,
24
25    // Like Open, but allows picking multiple files to open.
26    OpenMultiple,
27
28    // Like Open, but selects a folder.
29    OpenFolder,
30
31    // Allows picking a nonexistent file, and prompts to overwrite if the file
32    // already exists.
33    Save,
34  };
35
36  Mode mode;
37
38  // Title to be used for the dialog. This may be empty for the default title,
39  // which will be either "Open" or "Save" depending on the mode.
40  string16 title;
41
42  // Default file name to select in the dialog.
43  base::FilePath default_file_name;
44
45  // A list of valid lower-cased MIME types or file extensions specified in an
46  // input element. It is used to restrict selectable files to such types.
47  std::vector<string16> accept_types;
48
49#if defined(OS_ANDROID)
50  // Used to select items other than files, i.e. camera/mic. See
51  // SelectFileDialog.java for more details.
52  string16 capture;
53#endif
54};
55
56}  // namespace content
57
58#endif  // CONTENT_PUBLIC_COMMON_FILE_CHOOSER_PARAMS_H_
59