| 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 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" |
| 6 | 6 |
| 7 #include <sys/stat.h> | 7 #include <sys/stat.h> |
| 8 #include <sys/statvfs.h> | 8 #include <sys/statvfs.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <utime.h> | 10 #include <utime.h> |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 // Extension source URL. | 531 // Extension source URL. |
| 532 scoped_refptr<const Extension> extension_; | 532 scoped_refptr<const Extension> extension_; |
| 533 DISALLOW_COPY_AND_ASSIGN(LocalFileSystemCallbackDispatcher); | 533 DISALLOW_COPY_AND_ASSIGN(LocalFileSystemCallbackDispatcher); |
| 534 }; | 534 }; |
| 535 | 535 |
| 536 FileBrowserPrivateAPI::FileBrowserPrivateAPI(Profile* profile) | 536 FileBrowserPrivateAPI::FileBrowserPrivateAPI(Profile* profile) |
| 537 : event_router_(make_scoped_refptr(new FileBrowserEventRouter(profile))) { | 537 : event_router_(make_scoped_refptr(new FileBrowserEventRouter(profile))) { |
| 538 extensions::ManifestHandler::Register( | 538 extensions::ManifestHandler::Register( |
| 539 extension_manifest_keys::kFileBrowserHandlers, | 539 extension_manifest_keys::kFileBrowserHandlers, |
| 540 new FileBrowserHandlerParser); | 540 new FileBrowserHandlerParser); |
| 541 | |
| 542 ExtensionFunctionRegistry* registry = | |
| 543 ExtensionFunctionRegistry::GetInstance(); | |
| 544 registry->RegisterFunction<CancelFileDialogFunction>(); | |
| 545 registry->RegisterFunction<ExecuteTasksFileBrowserFunction>(); | |
| 546 registry->RegisterFunction<SetDefaultTaskFileBrowserFunction>(); | |
| 547 registry->RegisterFunction<FileDialogStringsFunction>(); | |
| 548 registry->RegisterFunction<GetFileTasksFileBrowserFunction>(); | |
| 549 registry->RegisterFunction<GetVolumeMetadataFunction>(); | |
| 550 registry->RegisterFunction<RequestLocalFileSystemFunction>(); | |
| 551 registry->RegisterFunction<AddFileWatchBrowserFunction>(); | |
| 552 registry->RegisterFunction<RemoveFileWatchBrowserFunction>(); | |
| 553 registry->RegisterFunction<SelectFileFunction>(); | |
| 554 registry->RegisterFunction<SelectFilesFunction>(); | |
| 555 registry->RegisterFunction<AddMountFunction>(); | |
| 556 registry->RegisterFunction<RemoveMountFunction>(); | |
| 557 registry->RegisterFunction<GetMountPointsFunction>(); | |
| 558 registry->RegisterFunction<GetSizeStatsFunction>(); | |
| 559 registry->RegisterFunction<FormatDeviceFunction>(); | |
| 560 registry->RegisterFunction<ViewFilesFunction>(); | |
| 561 registry->RegisterFunction<ToggleFullscreenFunction>(); | |
| 562 registry->RegisterFunction<IsFullscreenFunction>(); | |
| 563 registry->RegisterFunction<GetDriveFilePropertiesFunction>(); | |
| 564 registry->RegisterFunction<PinDriveFileFunction>(); | |
| 565 registry->RegisterFunction<GetFileLocationsFunction>(); | |
| 566 registry->RegisterFunction<GetDriveFilesFunction>(); | |
| 567 registry->RegisterFunction<GetFileTransfersFunction>(); | |
| 568 registry->RegisterFunction<CancelFileTransfersFunction>(); | |
| 569 registry->RegisterFunction<TransferFileFunction>(); | |
| 570 registry->RegisterFunction<GetPreferencesFunction>(); | |
| 571 registry->RegisterFunction<SetPreferencesFunction>(); | |
| 572 registry->RegisterFunction<SearchDriveFunction>(); | |
| 573 registry->RegisterFunction<ClearDriveCacheFunction>(); | |
| 574 registry->RegisterFunction<ReloadDriveFunction>(); | |
| 575 registry->RegisterFunction<GetNetworkConnectionStateFunction>(); | |
| 576 registry->RegisterFunction<RequestDirectoryRefreshFunction>(); | |
| 577 registry->RegisterFunction<SetLastModifiedFunction>(); | |
| 578 registry->RegisterFunction<ZipSelectionFunction>(); | |
| 579 | |
| 580 event_router_->ObserveFileSystemEvents(); | 541 event_router_->ObserveFileSystemEvents(); |
| 581 } | 542 } |
| 582 | 543 |
| 583 FileBrowserPrivateAPI::~FileBrowserPrivateAPI() { | 544 FileBrowserPrivateAPI::~FileBrowserPrivateAPI() { |
| 584 } | 545 } |
| 585 | 546 |
| 586 void FileBrowserPrivateAPI::Shutdown() { | 547 void FileBrowserPrivateAPI::Shutdown() { |
| 587 event_router_->Shutdown(); | 548 event_router_->Shutdown(); |
| 588 } | 549 } |
| 589 | 550 |
| (...skipping 2423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3013 // Keep the refcount until the zipping is complete on utility process. | 2974 // Keep the refcount until the zipping is complete on utility process. |
| 3014 AddRef(); | 2975 AddRef(); |
| 3015 return true; | 2976 return true; |
| 3016 } | 2977 } |
| 3017 | 2978 |
| 3018 void ZipSelectionFunction::OnZipDone(bool success) { | 2979 void ZipSelectionFunction::OnZipDone(bool success) { |
| 3019 SetResult(new base::FundamentalValue(success)); | 2980 SetResult(new base::FundamentalValue(success)); |
| 3020 SendResponse(true); | 2981 SendResponse(true); |
| 3021 Release(); | 2982 Release(); |
| 3022 } | 2983 } |
| OLD | NEW |