| 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 // File contains the fileBrowserHandlerInternal.selectFile extension function. | 5 // File contains the fileBrowserHandlerInternal.selectFile extension function. |
| 6 // The function prompts user to select a file path to be used by the caller. It | 6 // The function prompts user to select a file path to be used by the caller. It |
| 7 // will fail if it isn't invoked by a user gesture (e.g. a mouse click or a | 7 // will fail if it isn't invoked by a user gesture (e.g. a mouse click or a |
| 8 // keyboard key press). | 8 // keyboard key press). |
| 9 // Note that the target file is never actually created by this function, even | 9 // Note that the target file is never actually created by this function, even |
| 10 // if the selected path doesn't exist. | 10 // if the selected path doesn't exist. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // |full_path| The selected file path if one was selected. It is ignored if | 103 // |full_path| The selected file path if one was selected. It is ignored if |
| 104 // the selection did not succeed. | 104 // the selection did not succeed. |
| 105 void OnFilePathSelected(bool success, const base::FilePath& full_path); | 105 void OnFilePathSelected(bool success, const base::FilePath& full_path); |
| 106 | 106 |
| 107 protected: | 107 protected: |
| 108 // The class is ref counted, so destructor should not be public. | 108 // The class is ref counted, so destructor should not be public. |
| 109 virtual ~FileBrowserHandlerInternalSelectFileFunction(); | 109 virtual ~FileBrowserHandlerInternalSelectFileFunction(); |
| 110 | 110 |
| 111 // AsyncExtensionFunction implementation. | 111 // AsyncExtensionFunction implementation. |
| 112 // Runs the extension function implementation. | 112 // Runs the extension function implementation. |
| 113 virtual bool RunAsync() OVERRIDE; | 113 virtual bool RunAsync() override; |
| 114 | 114 |
| 115 private: | 115 private: |
| 116 // Respond to the API with selected entry definition. | 116 // Respond to the API with selected entry definition. |
| 117 void RespondEntryDefinition( | 117 void RespondEntryDefinition( |
| 118 const file_manager::util::EntryDefinition& entry_definition); | 118 const file_manager::util::EntryDefinition& entry_definition); |
| 119 | 119 |
| 120 // Creates dictionary value that will be used to as the extension function's | 120 // Creates dictionary value that will be used to as the extension function's |
| 121 // callback argument and ends extension function execution by calling | 121 // callback argument and ends extension function execution by calling |
| 122 // |SendResponse(true)|. | 122 // |SendResponse(true)|. |
| 123 // The |results_| value will be set to dictionary containing two properties: | 123 // The |results_| value will be set to dictionary containing two properties: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 137 | 137 |
| 138 // List of permissions and paths that have to be granted for the selected | 138 // List of permissions and paths that have to be granted for the selected |
| 139 // files. | 139 // files. |
| 140 std::vector<std::pair<base::FilePath, int> > permissions_to_grant_; | 140 std::vector<std::pair<base::FilePath, int> > permissions_to_grant_; |
| 141 | 141 |
| 142 DECLARE_EXTENSION_FUNCTION("fileBrowserHandlerInternal.selectFile", | 142 DECLARE_EXTENSION_FUNCTION("fileBrowserHandlerInternal.selectFile", |
| 143 FILEBROWSERHANDLERINTERNAL_SELECTFILE) | 143 FILEBROWSERHANDLERINTERNAL_SELECTFILE) |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_HANDLER_
API_H_ | 146 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_HANDLER_
API_H_ |
| OLD | NEW |