OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_ENTRY_PICKER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_ENTRY_PICKER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_ENTRY_PICKER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_ENTRY_PICKER_H_ |
7 | 7 |
8 #include "chrome/browser/extensions/extension_function.h" | 8 #include "chrome/browser/extensions/extension_function.h" |
9 #include "ui/base/dialogs/select_file_dialog.h" | 9 #include "ui/base/dialogs/select_file_dialog.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 class WebContents; | 12 class WebContents; |
13 } | 13 } |
14 | 14 |
15 namespace extensions { | 15 namespace extensions { |
16 | 16 |
17 namespace api { | 17 namespace api { |
18 | 18 |
19 class DeveloperPrivateChooseEntryFunction; | 19 class DeveloperPrivateChooseEntryFunction; |
20 | 20 |
21 // Handles showing a dialog to the user to ask for the directory name. | 21 // Handles showing a dialog to the user to ask for the directory name. |
22 class EntryPicker : public ui::SelectFileDialog::Listener { | 22 class EntryPicker : public ui::SelectFileDialog::Listener { |
23 public: | 23 public: |
24 EntryPicker(DeveloperPrivateChooseEntryFunction* function, | 24 EntryPicker(DeveloperPrivateChooseEntryFunction* function, |
25 content::WebContents* web_contents, | 25 content::WebContents* web_contents, |
26 ui::SelectFileDialog::Type picker_type, | 26 ui::SelectFileDialog::Type picker_type, |
27 const FilePath& last_directory, | 27 const FilePath& last_directory, |
28 const string16& select_title); | 28 const string16& select_title, |
| 29 const ui::SelectFileDialog::FileTypeInfo& info, |
| 30 int file_type_index); |
29 | 31 |
30 // Allow picker UI to be skipped in testing. | 32 // Allow picker UI to be skipped in testing. |
31 static void SkipPickerAndAlwaysSelectPathForTest(FilePath* path); | 33 static void SkipPickerAndAlwaysSelectPathForTest(FilePath* path); |
32 static void SkipPickerAndAlwaysCancelForTest(); | 34 static void SkipPickerAndAlwaysCancelForTest(); |
33 static void StopSkippingPickerForTest(); | 35 static void StopSkippingPickerForTest(); |
34 | 36 |
35 protected: | 37 protected: |
36 | 38 |
37 virtual ~EntryPicker(); | 39 virtual ~EntryPicker(); |
38 | 40 |
39 private: | 41 private: |
40 // ui::SelectFileDialog::Listener implementation. | 42 // ui::SelectFileDialog::Listener implementation. |
41 virtual void FileSelected(const FilePath& path, | 43 virtual void FileSelected(const FilePath& path, |
42 int index, | 44 int index, |
43 void* params) OVERRIDE; | 45 void* params) OVERRIDE; |
44 | 46 |
45 virtual void FileSelectionCanceled(void* params) OVERRIDE; | 47 virtual void FileSelectionCanceled(void* params) OVERRIDE; |
46 | 48 |
47 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; | 49 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; |
48 scoped_refptr<DeveloperPrivateChooseEntryFunction> function_; | 50 scoped_refptr<DeveloperPrivateChooseEntryFunction> function_; |
49 | 51 |
50 DISALLOW_COPY_AND_ASSIGN(EntryPicker); | 52 DISALLOW_COPY_AND_ASSIGN(EntryPicker); |
51 }; | 53 }; |
52 | 54 |
53 } // namespace api | 55 } // namespace api |
54 | 56 |
55 } // namespace extensions | 57 } // namespace extensions |
56 | 58 |
57 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_ENTRY_PICKER_H_ | 59 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_ENTRY_PICKER_H_ |
OLD | NEW |