OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This file provides API functions for the file manager to act as the file | 5 // This file provides API functions for the file manager to act as the file |
6 // dialog for opening and saving files. | 6 // dialog for opening and saving files. |
7 | 7 |
8 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DIALOG_H_ | 8 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DIALOG_H_ |
9 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DIALOG_H_ | 9 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DIALOG_H_ |
10 | 10 |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" | 13 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" |
14 | 14 |
15 namespace ui { | 15 namespace ui { |
16 struct SelectedFileInfo; | 16 struct SelectedFileInfo; |
17 } | 17 } |
18 | 18 |
19 namespace extensions { | 19 namespace extensions { |
20 | 20 |
21 // Cancel file selection Dialog. Closes the dialog window. | 21 // Cancel file selection Dialog. Closes the dialog window. |
22 class FileBrowserPrivateCancelDialogFunction | 22 class FileManagerPrivateCancelDialogFunction |
23 : public LoggedAsyncExtensionFunction { | 23 : public LoggedAsyncExtensionFunction { |
24 public: | 24 public: |
25 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.cancelDialog", | 25 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.cancelDialog", |
26 FILEBROWSERPRIVATE_CANCELDIALOG) | 26 FILEMANAGERPRIVATE_CANCELDIALOG) |
27 | 27 |
28 protected: | 28 protected: |
29 virtual ~FileBrowserPrivateCancelDialogFunction() {} | 29 virtual ~FileManagerPrivateCancelDialogFunction() {} |
30 | 30 |
31 // AsyncExtensionFunction overrides. | 31 // AsyncExtensionFunction overrides. |
32 virtual bool RunAsync() OVERRIDE; | 32 virtual bool RunAsync() OVERRIDE; |
33 }; | 33 }; |
34 | 34 |
35 class FileBrowserPrivateSelectFileFunction | 35 class FileManagerPrivateSelectFileFunction |
36 : public LoggedAsyncExtensionFunction { | 36 : public LoggedAsyncExtensionFunction { |
37 public: | 37 public: |
38 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.selectFile", | 38 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.selectFile", |
39 FILEBROWSERPRIVATE_SELECTFILE) | 39 FILEMANAGERPRIVATE_SELECTFILE) |
40 | 40 |
41 protected: | 41 protected: |
42 virtual ~FileBrowserPrivateSelectFileFunction() {} | 42 virtual ~FileManagerPrivateSelectFileFunction() {} |
43 | 43 |
44 // AsyncExtensionFunction overrides. | 44 // AsyncExtensionFunction overrides. |
45 virtual bool RunAsync() OVERRIDE; | 45 virtual bool RunAsync() OVERRIDE; |
46 | 46 |
47 private: | 47 private: |
48 // A callback method to handle the result of GetSelectedFileInfo. | 48 // A callback method to handle the result of GetSelectedFileInfo. |
49 void GetSelectedFileInfoResponse( | 49 void GetSelectedFileInfoResponse( |
50 int index, | 50 int index, |
51 const std::vector<ui::SelectedFileInfo>& files); | 51 const std::vector<ui::SelectedFileInfo>& files); |
52 }; | 52 }; |
53 | 53 |
54 // Select multiple files. Closes the dialog window. | 54 // Select multiple files. Closes the dialog window. |
55 class FileBrowserPrivateSelectFilesFunction | 55 class FileManagerPrivateSelectFilesFunction |
56 : public LoggedAsyncExtensionFunction { | 56 : public LoggedAsyncExtensionFunction { |
57 public: | 57 public: |
58 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.selectFiles", | 58 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.selectFiles", |
59 FILEBROWSERPRIVATE_SELECTFILES) | 59 FILEMANAGERPRIVATE_SELECTFILES) |
60 | 60 |
61 protected: | 61 protected: |
62 virtual ~FileBrowserPrivateSelectFilesFunction() {} | 62 virtual ~FileManagerPrivateSelectFilesFunction() {} |
63 | 63 |
64 // AsyncExtensionFunction overrides. | 64 // AsyncExtensionFunction overrides. |
65 virtual bool RunAsync() OVERRIDE; | 65 virtual bool RunAsync() OVERRIDE; |
66 | 66 |
67 private: | 67 private: |
68 // A callback method to handle the result of GetSelectedFileInfo. | 68 // A callback method to handle the result of GetSelectedFileInfo. |
69 void GetSelectedFileInfoResponse( | 69 void GetSelectedFileInfoResponse( |
70 const std::vector<ui::SelectedFileInfo>& files); | 70 const std::vector<ui::SelectedFileInfo>& files); |
71 }; | 71 }; |
72 | 72 |
73 } // namespace extensions | 73 } // namespace extensions |
74 | 74 |
75 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DIALOG_H_ | 75 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DIALOG_H_ |
OLD | NEW |