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_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_ |
7 | 7 |
8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
9 #include "chrome/browser/extensions/api/developer_private/entry_picker.h" | 9 #include "chrome/browser/extensions/api/developer_private/entry_picker.h" |
10 #include "chrome/browser/extensions/api/file_system/file_system_api.h" | 10 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 DeveloperPrivateExportSyncfsFolderToLocalfsFunction(); | 344 DeveloperPrivateExportSyncfsFolderToLocalfsFunction(); |
345 | 345 |
346 protected: | 346 protected: |
347 virtual ~DeveloperPrivateExportSyncfsFolderToLocalfsFunction(); | 347 virtual ~DeveloperPrivateExportSyncfsFolderToLocalfsFunction(); |
348 | 348 |
349 // ExtensionFunction | 349 // ExtensionFunction |
350 virtual bool RunImpl() OVERRIDE; | 350 virtual bool RunImpl() OVERRIDE; |
351 | 351 |
352 void ClearPrexistingDirectoryContent(const base::FilePath& project_path); | 352 void ClearPrexistingDirectoryContent(const base::FilePath& project_path); |
353 | 353 |
354 void ReadSyncFileSystemDirectory(const base::FilePath& project_path); | 354 void ReadSyncFileSystemDirectory(const base::FilePath& project_path, |
| 355 const base::FilePath& destination_path); |
355 | 356 |
356 void ReadSyncFileSystemDirectoryCb( | 357 void ReadSyncFileSystemDirectoryCb( |
357 const base::FilePath& project_path, | 358 const base::FilePath& project_path, |
| 359 const base::FilePath& destination_path, |
358 base::PlatformFileError result, | 360 base::PlatformFileError result, |
359 const fileapi::FileSystemOperation::FileEntryList& file_list, | 361 const fileapi::FileSystemOperation::FileEntryList& file_list, |
360 bool has_more); | 362 bool has_more); |
361 | 363 |
362 void CreateFolderAndSendResponse(const base::FilePath& project_path); | |
363 | |
364 void SnapshotFileCallback( | 364 void SnapshotFileCallback( |
365 const base::FilePath& target_path, | 365 const base::FilePath& target_path, |
366 base::PlatformFileError result, | 366 base::PlatformFileError result, |
367 const base::PlatformFileInfo& file_info, | 367 const base::PlatformFileInfo& file_info, |
368 const base::FilePath& platform_path, | 368 const base::FilePath& platform_path, |
369 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); | 369 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); |
370 | 370 |
371 void CopyFile(const base::FilePath& src_path, | 371 void CopyFile(const base::FilePath& src_path, |
372 const base::FilePath& dest_path); | 372 const base::FilePath& dest_path); |
373 | 373 |
374 scoped_refptr<fileapi::FileSystemContext> context_; | 374 scoped_refptr<fileapi::FileSystemContext> context_; |
375 | 375 |
376 private: | 376 private: |
377 int pendingCallbacksCount_; | 377 int pendingCopyOperationsCount_; |
378 | 378 |
379 // This is set to false if any of the copyFile operations fail on | 379 // This is set to false if any of the copyFile operations fail on |
380 // call of the API. It is returned as a response of the API call. | 380 // call of the API. It is returned as a response of the API call. |
381 bool success_; | 381 bool success_; |
382 }; | 382 }; |
383 | 383 |
384 class DeveloperPrivateLoadProjectFunction : public AsyncExtensionFunction { | 384 class DeveloperPrivateLoadProjectFunction : public AsyncExtensionFunction { |
385 public: | 385 public: |
386 DECLARE_EXTENSION_FUNCTION("developerPrivate.loadProject", | 386 DECLARE_EXTENSION_FUNCTION("developerPrivate.loadProject", |
387 DEVELOPERPRIVATE_LOADPROJECT); | 387 DEVELOPERPRIVATE_LOADPROJECT); |
388 | 388 |
389 DeveloperPrivateLoadProjectFunction(); | 389 DeveloperPrivateLoadProjectFunction(); |
390 | 390 |
391 protected: | 391 protected: |
392 virtual ~DeveloperPrivateLoadProjectFunction(); | 392 virtual ~DeveloperPrivateLoadProjectFunction(); |
393 | 393 |
394 // ExtensionFunction | 394 // ExtensionFunction |
395 virtual bool RunImpl() OVERRIDE; | 395 virtual bool RunImpl() OVERRIDE; |
396 | 396 |
397 void GetUnpackedExtension(const base::FilePath& path, | 397 void GetUnpackedExtension(const base::FilePath& path, |
398 const ExtensionSet* extensions); | 398 const ExtensionSet* extensions); |
399 }; | 399 }; |
400 | 400 |
401 } // namespace api | 401 } // namespace api |
402 | 402 |
403 } // namespace extensions | 403 } // namespace extensions |
404 | 404 |
405 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ | 405 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ |
OLD | NEW |