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 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_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> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 // AsyncExtensionFunction overrides. | 45 // AsyncExtensionFunction overrides. |
46 virtual bool RunImpl() OVERRIDE; | 46 virtual bool RunImpl() OVERRIDE; |
47 | 47 |
48 private: | 48 private: |
49 class LocalFileSystemCallbackDispatcher; | 49 class LocalFileSystemCallbackDispatcher; |
50 | 50 |
51 void RespondSuccessOnUIThread(const std::string& name, | 51 void RespondSuccessOnUIThread(const std::string& name, |
52 const GURL& root_path); | 52 const GURL& root_path); |
53 void RespondFailedOnUIThread(base::PlatformFileError error_code); | 53 void RespondFailedOnUIThread(base::PlatformFileError error_code); |
54 void RequestOnFileThread(const GURL& source_url, int child_id); | 54 void RequestOnFileThread( |
| 55 scoped_refptr<fileapi::FileSystemContext> file_system_context, |
| 56 const GURL& source_url, |
| 57 int child_id); |
55 }; | 58 }; |
56 | 59 |
57 // Implements the chrome.fileBrowserPrivate.addFileWatch method. | 60 // Implements the chrome.fileBrowserPrivate.addFileWatch method. |
58 class FileWatchBrowserFunctionBase : public AsyncExtensionFunction { | 61 class FileWatchBrowserFunctionBase : public AsyncExtensionFunction { |
59 protected: | 62 protected: |
60 virtual ~FileWatchBrowserFunctionBase() {} | 63 virtual ~FileWatchBrowserFunctionBase() {} |
61 | 64 |
62 virtual bool PerformFileWatchOperation( | 65 virtual bool PerformFileWatchOperation( |
63 scoped_refptr<FileBrowserEventRouter> event_router, | 66 scoped_refptr<FileBrowserEventRouter> event_router, |
64 const FilePath& local_path, const FilePath& virtual_path, | 67 const FilePath& local_path, const FilePath& virtual_path, |
65 const std::string& extension_id) = 0; | 68 const std::string& extension_id) = 0; |
66 | 69 |
67 // AsyncExtensionFunction overrides. | 70 // AsyncExtensionFunction overrides. |
68 virtual bool RunImpl() OVERRIDE; | 71 virtual bool RunImpl() OVERRIDE; |
69 | 72 |
70 private: | 73 private: |
71 bool GetLocalFilePath(const GURL& file_url, FilePath* local_path, | 74 bool GetLocalFilePath( |
72 FilePath* virtual_path); | 75 scoped_refptr<fileapi::FileSystemContext> file_system_context, |
| 76 const GURL& file_url, FilePath* local_path, FilePath* virtual_path); |
73 void RespondOnUIThread(bool success); | 77 void RespondOnUIThread(bool success); |
74 void RunFileWatchOperationOnFileThread( | 78 void RunFileWatchOperationOnFileThread( |
| 79 scoped_refptr<fileapi::FileSystemContext> file_system_context, |
75 scoped_refptr<FileBrowserEventRouter> event_router, | 80 scoped_refptr<FileBrowserEventRouter> event_router, |
76 const GURL& file_url, | 81 const GURL& file_url, |
77 const std::string& extension_id); | 82 const std::string& extension_id); |
78 }; | 83 }; |
79 | 84 |
80 // Implements the chrome.fileBrowserPrivate.addFileWatch method. | 85 // Implements the chrome.fileBrowserPrivate.addFileWatch method. |
81 class AddFileWatchBrowserFunction : public FileWatchBrowserFunctionBase { | 86 class AddFileWatchBrowserFunction : public FileWatchBrowserFunctionBase { |
82 public: | 87 public: |
83 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.addFileWatch"); | 88 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.addFileWatch"); |
84 | 89 |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 DECLARE_EXTENSION_FUNCTION_NAME( | 708 DECLARE_EXTENSION_FUNCTION_NAME( |
704 "fileBrowserPrivate.requestDirectoryRefresh"); | 709 "fileBrowserPrivate.requestDirectoryRefresh"); |
705 | 710 |
706 protected: | 711 protected: |
707 virtual ~RequestDirectoryRefreshFunction() {} | 712 virtual ~RequestDirectoryRefreshFunction() {} |
708 | 713 |
709 virtual bool RunImpl() OVERRIDE; | 714 virtual bool RunImpl() OVERRIDE; |
710 }; | 715 }; |
711 | 716 |
712 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 717 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
OLD | NEW |