| 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 fileapi::ExternalFileSystemMountPointProvider* provider = | 508 fileapi::ExternalFileSystemMountPointProvider* provider = |
| 509 file_system_context_->external_provider(); | 509 file_system_context_->external_provider(); |
| 510 if (!provider) | 510 if (!provider) |
| 511 return false; | 511 return false; |
| 512 | 512 |
| 513 // Grant full access to File API from this component extension. | 513 // Grant full access to File API from this component extension. |
| 514 provider->GrantFullAccessToExtension(extension_->id()); | 514 provider->GrantFullAccessToExtension(extension_->id()); |
| 515 | 515 |
| 516 // Grant R/W file permissions to the renderer hosting component | 516 // Grant R/W file permissions to the renderer hosting component |
| 517 // extension for all paths exposed by our local file system provider. | 517 // extension for all paths exposed by our local file system provider. |
| 518 std::vector<FilePath> root_dirs = provider->GetRootDirectories(); | 518 std::vector<FilePath> root_dirs = provider->GetRootDirectories(true); |
| 519 for (size_t i = 0; i < root_dirs.size(); ++i) { | 519 for (size_t i = 0; i < root_dirs.size(); ++i) { |
| 520 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( | 520 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( |
| 521 child_id_, root_dirs[i], | 521 child_id_, root_dirs[i], |
| 522 file_handler_util::GetReadWritePermissions()); | 522 file_handler_util::GetReadWritePermissions()); |
| 523 } | 523 } |
| 524 return true; | 524 return true; |
| 525 } | 525 } |
| 526 | 526 |
| 527 RequestLocalFileSystemFunction* function_; | 527 RequestLocalFileSystemFunction* function_; |
| 528 scoped_refptr<fileapi::FileSystemContext> file_system_context_; | 528 scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
| (...skipping 2484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3013 // Keep the refcount until the zipping is complete on utility process. | 3013 // Keep the refcount until the zipping is complete on utility process. |
| 3014 AddRef(); | 3014 AddRef(); |
| 3015 return true; | 3015 return true; |
| 3016 } | 3016 } |
| 3017 | 3017 |
| 3018 void ZipSelectionFunction::OnZipDone(bool success) { | 3018 void ZipSelectionFunction::OnZipDone(bool success) { |
| 3019 SetResult(new base::FundamentalValue(success)); | 3019 SetResult(new base::FundamentalValue(success)); |
| 3020 SendResponse(true); | 3020 SendResponse(true); |
| 3021 Release(); | 3021 Release(); |
| 3022 } | 3022 } |
| OLD | NEW |