OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string> | 9 #include <string> |
10 | 10 |
11 #include "base/file_path.h" | 11 #include "base/platform_file.h" |
12 #include "chrome/browser/extensions/extension_function.h" | 12 #include "chrome/browser/extensions/extension_function.h" |
13 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 13 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
14 | 14 |
| 15 class GURL; |
| 16 |
15 // Implements the Chrome Extension local File API. | 17 // Implements the Chrome Extension local File API. |
16 class RequestLocalFileSystemFunction | 18 class RequestLocalFileSystemFunction |
17 : public AsyncExtensionFunction { | 19 : public AsyncExtensionFunction { |
18 public: | 20 public: |
19 RequestLocalFileSystemFunction(); | 21 RequestLocalFileSystemFunction(); |
20 | 22 |
21 protected: | 23 protected: |
22 virtual ~RequestLocalFileSystemFunction(); | 24 virtual ~RequestLocalFileSystemFunction(); |
23 | 25 |
24 // AsyncExtensionFunction overrides. | 26 // AsyncExtensionFunction overrides. |
25 virtual bool RunImpl() OVERRIDE; | 27 virtual bool RunImpl() OVERRIDE; |
26 | 28 |
27 private: | 29 private: |
28 friend class LocalFileSystemCallbackDispatcher; | 30 friend class LocalFileSystemCallbackDispatcher; |
29 void RespondSuccessOnUIThread(const std::string& name, | 31 void RespondSuccessOnUIThread(const std::string& name, |
30 const FilePath& path); | 32 const GURL& root); |
31 void RespondFailedOnUIThread(base::PlatformFileError error_code); | 33 void RespondFailedOnUIThread(base::PlatformFileError error_code); |
32 | 34 |
33 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.requestLocalFileSystem"); | 35 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.requestLocalFileSystem"); |
34 }; | 36 }; |
35 | 37 |
36 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FILE_BROWSER_PRIVATE_API_H_ | 38 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FILE_BROWSER_PRIVATE_API_H_ |
OLD | NEW |