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 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" | 12 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 struct SelectedFileInfo; | 15 struct SelectedFileInfo; |
16 } | 16 } |
17 | 17 |
18 namespace extensions { | 18 namespace extensions { |
19 | 19 |
20 // Cancel file selection Dialog. Closes the dialog window. | 20 // Cancel file selection Dialog. Closes the dialog window. |
21 class CancelFileDialogFunction : public LoggedAsyncExtensionFunction { | 21 class FileBrowserPrivateCancelDialogFunction |
| 22 : public LoggedAsyncExtensionFunction { |
22 public: | 23 public: |
23 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.cancelDialog", | 24 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.cancelDialog", |
24 FILEBROWSERPRIVATE_CANCELDIALOG) | 25 FILEBROWSERPRIVATE_CANCELDIALOG) |
25 | 26 |
26 CancelFileDialogFunction(); | 27 FileBrowserPrivateCancelDialogFunction(); |
27 | 28 |
28 protected: | 29 protected: |
29 virtual ~CancelFileDialogFunction(); | 30 virtual ~FileBrowserPrivateCancelDialogFunction(); |
30 | 31 |
31 // AsyncExtensionFunction overrides. | 32 // AsyncExtensionFunction overrides. |
32 virtual bool RunImpl() OVERRIDE; | 33 virtual bool RunImpl() OVERRIDE; |
33 }; | 34 }; |
34 | 35 |
35 class SelectFileFunction : public LoggedAsyncExtensionFunction { | 36 class FileBrowserPrivateSelectFileFunction |
| 37 : public LoggedAsyncExtensionFunction { |
36 public: | 38 public: |
37 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.selectFile", | 39 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.selectFile", |
38 FILEBROWSERPRIVATE_SELECTFILE) | 40 FILEBROWSERPRIVATE_SELECTFILE) |
39 | 41 |
40 SelectFileFunction(); | 42 FileBrowserPrivateSelectFileFunction(); |
41 | 43 |
42 protected: | 44 protected: |
43 virtual ~SelectFileFunction(); | 45 virtual ~FileBrowserPrivateSelectFileFunction(); |
44 | 46 |
45 // AsyncExtensionFunction overrides. | 47 // AsyncExtensionFunction overrides. |
46 virtual bool RunImpl() OVERRIDE; | 48 virtual bool RunImpl() OVERRIDE; |
47 | 49 |
48 private: | 50 private: |
49 // A callback method to handle the result of GetSelectedFileInfo. | 51 // A callback method to handle the result of GetSelectedFileInfo. |
50 void GetSelectedFileInfoResponse( | 52 void GetSelectedFileInfoResponse( |
51 const std::vector<ui::SelectedFileInfo>& files); | 53 const std::vector<ui::SelectedFileInfo>& files); |
52 }; | 54 }; |
53 | 55 |
54 // Select multiple files. Closes the dialog window. | 56 // Select multiple files. Closes the dialog window. |
55 class SelectFilesFunction : public LoggedAsyncExtensionFunction { | 57 class FileBrowserPrivateSelectFilesFunction |
| 58 : public LoggedAsyncExtensionFunction { |
56 public: | 59 public: |
57 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.selectFiles", | 60 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.selectFiles", |
58 FILEBROWSERPRIVATE_SELECTFILES) | 61 FILEBROWSERPRIVATE_SELECTFILES) |
59 | 62 |
60 SelectFilesFunction(); | 63 FileBrowserPrivateSelectFilesFunction(); |
61 | 64 |
62 protected: | 65 protected: |
63 virtual ~SelectFilesFunction(); | 66 virtual ~FileBrowserPrivateSelectFilesFunction(); |
64 | 67 |
65 // AsyncExtensionFunction overrides. | 68 // AsyncExtensionFunction overrides. |
66 virtual bool RunImpl() OVERRIDE; | 69 virtual bool RunImpl() OVERRIDE; |
67 | 70 |
68 private: | 71 private: |
69 // A callback method to handle the result of GetSelectedFileInfo. | 72 // A callback method to handle the result of GetSelectedFileInfo. |
70 void GetSelectedFileInfoResponse( | 73 void GetSelectedFileInfoResponse( |
71 const std::vector<ui::SelectedFileInfo>& files); | 74 const std::vector<ui::SelectedFileInfo>& files); |
72 }; | 75 }; |
73 | 76 |
74 } // namespace extensions | 77 } // namespace extensions |
75 | 78 |
76 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DIALOG_H_ | 79 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DIALOG_H_ |
OLD | NEW |