| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_file_browser_private_api.h" | 5 #include "chrome/browser/extensions/extension_file_browser_private_api.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 false); // create | 688 false); // create |
| 689 FilePath final_file_path = root_path.Append(virtual_path); | 689 FilePath final_file_path = root_path.Append(virtual_path); |
| 690 | 690 |
| 691 fileapi::ExternalFileSystemMountPointProvider* external_provider = | 691 fileapi::ExternalFileSystemMountPointProvider* external_provider = |
| 692 path_manager->external_provider(); | 692 path_manager->external_provider(); |
| 693 if (!external_provider) | 693 if (!external_provider) |
| 694 return false; | 694 return false; |
| 695 | 695 |
| 696 // Check if this file system entry exists first. | 696 // Check if this file system entry exists first. |
| 697 base::PlatformFileInfo file_info; | 697 base::PlatformFileInfo file_info; |
| 698 FilePath platform_path; | 698 |
| 699 fileapi::FileSystemOperationContext file_system_operation_context( | 699 if (!file_util::PathExists(final_file_path) || |
| 700 profile_->GetFileSystemContext(), | 700 file_util::IsLink(final_file_path) || |
| 701 external_provider->GetFileSystemFileUtil()); | 701 !file_util::GetFileInfo(final_file_path, &file_info)) |
| 702 if (base::PLATFORM_FILE_OK != | |
| 703 fileapi::FileSystemFileUtil::GetInstance()->GetFileInfo( | |
| 704 &file_system_operation_context, final_file_path, &file_info, | |
| 705 &platform_path)) { | |
| 706 return false; | 702 return false; |
| 707 } | |
| 708 | 703 |
| 709 // TODO(zelidrag): Let's just prevent all symlinks for now. We don't want a | 704 // TODO(zelidrag): Let's just prevent all symlinks for now. We don't want a |
| 710 // USB drive content to point to something in the rest of the file system. | 705 // USB drive content to point to something in the rest of the file system. |
| 711 // Ideally, we should permit symlinks within the boundary of the same | 706 // Ideally, we should permit symlinks within the boundary of the same |
| 712 // virtual mount point. | 707 // virtual mount point. |
| 713 if (file_info.is_symbolic_link) | 708 if (file_info.is_symbolic_link) |
| 714 return false; | 709 return false; |
| 715 | 710 |
| 716 // Get task details. | 711 // Get task details. |
| 717 std::string target_extension_id; | 712 std::string target_extension_id; |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 #undef SET_STRING | 1421 #undef SET_STRING |
| 1427 | 1422 |
| 1428 // TODO(serya): Create a new string in .grd file for this one in M13. | 1423 // TODO(serya): Create a new string in .grd file for this one in M13. |
| 1429 dict->SetString("PREVIEW_IMAGE", | 1424 dict->SetString("PREVIEW_IMAGE", |
| 1430 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); | 1425 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); |
| 1431 dict->SetString("PLAY_MEDIA", | 1426 dict->SetString("PLAY_MEDIA", |
| 1432 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); | 1427 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); |
| 1433 | 1428 |
| 1434 return true; | 1429 return true; |
| 1435 } | 1430 } |
| OLD | NEW |