| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EXTENSION_FILE_BROWSER_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FILE_BROWSER_PRIVATE_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FILE_BROWSER_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FILE_BROWSER_PRIVATE_API_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/file_path.h" | 13 #include "base/platform_file.h" |
| 14 #include "chrome/browser/extensions/extension_function.h" | 14 #include "chrome/browser/extensions/extension_function.h" |
| 15 #include "chrome/browser/ui/shell_dialogs.h" | 15 #include "chrome/browser/ui/shell_dialogs.h" |
| 16 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 16 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
| 17 | 17 |
| 18 class GURL; |
| 19 |
| 18 // Implements the Chrome Extension local File API. | 20 // Implements the Chrome Extension local File API. |
| 19 class RequestLocalFileSystemFunction | 21 class RequestLocalFileSystemFunction |
| 20 : public AsyncExtensionFunction { | 22 : public AsyncExtensionFunction { |
| 21 public: | 23 public: |
| 22 RequestLocalFileSystemFunction(); | 24 RequestLocalFileSystemFunction(); |
| 23 | 25 |
| 24 protected: | 26 protected: |
| 25 virtual ~RequestLocalFileSystemFunction(); | 27 virtual ~RequestLocalFileSystemFunction(); |
| 26 | 28 |
| 27 // AsyncExtensionFunction overrides. | 29 // AsyncExtensionFunction overrides. |
| 28 virtual bool RunImpl() OVERRIDE; | 30 virtual bool RunImpl() OVERRIDE; |
| 29 | 31 |
| 30 private: | 32 private: |
| 31 friend class LocalFileSystemCallbackDispatcher; | 33 friend class LocalFileSystemCallbackDispatcher; |
| 32 void RespondSuccessOnUIThread(const std::string& name, | 34 void RespondSuccessOnUIThread(const std::string& name, |
| 33 const FilePath& path); | 35 const GURL& root); |
| 34 void RespondFailedOnUIThread(base::PlatformFileError error_code); | 36 void RespondFailedOnUIThread(base::PlatformFileError error_code); |
| 35 | 37 |
| 36 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.requestLocalFileSystem"); | 38 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.requestLocalFileSystem"); |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 // Parent class for the chromium extension APIs for the file dialog. | 41 // Parent class for the chromium extension APIs for the file dialog. |
| 40 class FileDialogFunction | 42 class FileDialogFunction |
| 41 : public AsyncExtensionFunction { | 43 : public AsyncExtensionFunction { |
| 42 public: | 44 public: |
| 43 typedef std::vector<std::string> VirtualPathVec; | 45 typedef std::vector<std::string> VirtualPathVec; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 virtual ~FileDialogStringsFunction() {} | 140 virtual ~FileDialogStringsFunction() {} |
| 139 | 141 |
| 140 // AsyncExtensionFunction overrides. | 142 // AsyncExtensionFunction overrides. |
| 141 virtual bool RunImpl() OVERRIDE; | 143 virtual bool RunImpl() OVERRIDE; |
| 142 | 144 |
| 143 private: | 145 private: |
| 144 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getStrings"); | 146 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getStrings"); |
| 145 }; | 147 }; |
| 146 | 148 |
| 147 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FILE_BROWSER_PRIVATE_API_H_ | 149 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FILE_BROWSER_PRIVATE_API_H_ |
| OLD | NEW |