| 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/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 namespace { | 55 namespace { |
| 56 | 56 |
| 57 // Error messages. | 57 // Error messages. |
| 58 const char kFileError[] = "File error %d"; | 58 const char kFileError[] = "File error %d"; |
| 59 const char kInvalidFileUrl[] = "Invalid file URL"; | 59 const char kInvalidFileUrl[] = "Invalid file URL"; |
| 60 const char kVolumeDevicePathNotFound[] = "Device path not found"; | 60 const char kVolumeDevicePathNotFound[] = "Device path not found"; |
| 61 | 61 |
| 62 #ifdef OS_CHROMEOS | 62 #ifdef OS_CHROMEOS |
| 63 // Volume type strings. | 63 // Volume type strings. |
| 64 const std::string kVolumeTypeFlash = "flash"; | 64 const char kVolumeTypeFlash[] = "flash"; |
| 65 const std::string kVolumeTypeOptical = "optical"; | 65 const char kVolumeTypeOptical[] = "optical"; |
| 66 const std::string kVolumeTypeHardDrive = "hdd"; | 66 const char kVolumeTypeHardDrive[] = "hdd"; |
| 67 const std::string kVolumeTypeUnknown = "undefined"; | 67 const char kVolumeTypeUnknown[] = "undefined"; |
| 68 #endif | 68 #endif |
| 69 | 69 |
| 70 // Internal task ids. | 70 // Internal task ids. |
| 71 const char kEnqueueTaskId[] = "enqueue"; | 71 const char kEnqueueTaskId[] = "enqueue"; |
| 72 | 72 |
| 73 const int kReadOnlyFilePermissions = base::PLATFORM_FILE_OPEN | | 73 const int kReadOnlyFilePermissions = base::PLATFORM_FILE_OPEN | |
| 74 base::PLATFORM_FILE_READ | | 74 base::PLATFORM_FILE_READ | |
| 75 base::PLATFORM_FILE_EXCLUSIVE_READ | | 75 base::PLATFORM_FILE_EXCLUSIVE_READ | |
| 76 base::PLATFORM_FILE_ASYNC; | 76 base::PLATFORM_FILE_ASYNC; |
| 77 | 77 |
| (...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1484 volume_info->SetBoolean("isOnBootDevice", volume->on_boot_device()); | 1484 volume_info->SetBoolean("isOnBootDevice", volume->on_boot_device()); |
| 1485 | 1485 |
| 1486 return true; | 1486 return true; |
| 1487 } | 1487 } |
| 1488 #endif | 1488 #endif |
| 1489 error_ = kVolumeDevicePathNotFound; | 1489 error_ = kVolumeDevicePathNotFound; |
| 1490 return false; | 1490 return false; |
| 1491 } | 1491 } |
| 1492 | 1492 |
| 1493 #ifdef OS_CHROMEOS | 1493 #ifdef OS_CHROMEOS |
| 1494 const std::string& GetVolumeMetadataFunction::DeviceTypeToString( | 1494 std::string GetVolumeMetadataFunction::DeviceTypeToString( |
| 1495 chromeos::DeviceType type) { | 1495 chromeos::DeviceType type) { |
| 1496 switch (type) { | 1496 switch (type) { |
| 1497 case chromeos::FLASH: | 1497 case chromeos::FLASH: |
| 1498 return kVolumeTypeFlash; | 1498 return kVolumeTypeFlash; |
| 1499 case chromeos::OPTICAL: | 1499 case chromeos::OPTICAL: |
| 1500 return kVolumeTypeOptical; | 1500 return kVolumeTypeOptical; |
| 1501 case chromeos::HDD: | 1501 case chromeos::HDD: |
| 1502 return kVolumeTypeHardDrive; | 1502 return kVolumeTypeHardDrive; |
| 1503 default: | 1503 default: |
| 1504 break; | 1504 break; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1675 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); | 1675 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); |
| 1676 dict->SetString("PLAY_MEDIA", | 1676 dict->SetString("PLAY_MEDIA", |
| 1677 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); | 1677 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); |
| 1678 #if defined(OS_CHROMEOS) | 1678 #if defined(OS_CHROMEOS) |
| 1679 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePhotoEditor)) | 1679 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePhotoEditor)) |
| 1680 dict->SetString("ENABLE_PHOTO_EDITOR", "true"); | 1680 dict->SetString("ENABLE_PHOTO_EDITOR", "true"); |
| 1681 #endif | 1681 #endif |
| 1682 | 1682 |
| 1683 return true; | 1683 return true; |
| 1684 } | 1684 } |
| OLD | NEW |