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 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 RemoveMountFunction::~RemoveMountFunction() { | 1205 RemoveMountFunction::~RemoveMountFunction() { |
1206 } | 1206 } |
1207 | 1207 |
1208 bool RemoveMountFunction::RunImpl() { | 1208 bool RemoveMountFunction::RunImpl() { |
1209 if (args_->GetSize() != 1) { | 1209 if (args_->GetSize() != 1) { |
1210 return false; | 1210 return false; |
1211 } | 1211 } |
1212 | 1212 |
1213 std::string mount_path; | 1213 std::string mount_path; |
1214 if (!args_->GetString(0, &mount_path)) { | 1214 if (!args_->GetString(0, &mount_path)) { |
1215 return false; | 1215 return false; |
1216 } | 1216 } |
1217 | 1217 |
1218 UrlList file_paths; | 1218 UrlList file_paths; |
1219 file_paths.push_back(GURL(mount_path)); | 1219 file_paths.push_back(GURL(mount_path)); |
1220 | 1220 |
1221 BrowserThread::PostTask( | 1221 BrowserThread::PostTask( |
1222 BrowserThread::FILE, FROM_HERE, | 1222 BrowserThread::FILE, FROM_HERE, |
1223 NewRunnableMethod(this, | 1223 NewRunnableMethod(this, |
1224 &RemoveMountFunction::GetLocalPathsOnFileThread, | 1224 &RemoveMountFunction::GetLocalPathsOnFileThread, |
1225 file_paths, reinterpret_cast<void*>(NULL))); | 1225 file_paths, reinterpret_cast<void*>(NULL))); |
(...skipping 11 matching lines...) Expand all Loading... |
1237 } | 1237 } |
1238 | 1238 |
1239 #ifdef OS_CHROMEOS | 1239 #ifdef OS_CHROMEOS |
1240 chromeos::CrosLibrary::Get()->GetMountLibrary()->UnmountPath( | 1240 chromeos::CrosLibrary::Get()->GetMountLibrary()->UnmountPath( |
1241 files[0].value().c_str()); | 1241 files[0].value().c_str()); |
1242 #endif | 1242 #endif |
1243 | 1243 |
1244 SendResponse(true); | 1244 SendResponse(true); |
1245 } | 1245 } |
1246 | 1246 |
1247 | |
1248 GetMountPointsFunction::GetMountPointsFunction() { | 1247 GetMountPointsFunction::GetMountPointsFunction() { |
1249 } | 1248 } |
1250 | 1249 |
1251 GetMountPointsFunction::~GetMountPointsFunction() { | 1250 GetMountPointsFunction::~GetMountPointsFunction() { |
1252 } | 1251 } |
1253 | 1252 |
1254 bool GetMountPointsFunction::RunImpl() { | 1253 bool GetMountPointsFunction::RunImpl() { |
1255 if (args_->GetSize()) | 1254 if (args_->GetSize()) |
1256 return false; | 1255 return false; |
1257 | 1256 |
1258 base::ListValue *mounts = new base::ListValue(); | 1257 base::ListValue *mounts = new base::ListValue(); |
1259 result_.reset(mounts); | 1258 result_.reset(mounts); |
1260 | 1259 |
1261 #ifdef OS_CHROMEOS | 1260 #ifdef OS_CHROMEOS |
1262 chromeos::MountLibrary *mount_lib = | 1261 chromeos::MountLibrary *mount_lib = |
1263 chromeos::CrosLibrary::Get()->GetMountLibrary(); | 1262 chromeos::CrosLibrary::Get()->GetMountLibrary(); |
1264 chromeos::MountLibrary::MountPointMap mount_points = | 1263 chromeos::MountLibrary::MountPointMap mount_points = |
1265 mount_lib->mount_points(); | 1264 mount_lib->mount_points(); |
1266 | 1265 |
1267 for (chromeos::MountLibrary::MountPointMap::const_iterator it = | 1266 for (chromeos::MountLibrary::MountPointMap::const_iterator it = |
1268 mount_points.begin(); | 1267 mount_points.begin(); |
1269 it != mount_points.end(); | 1268 it != mount_points.end(); |
1270 ++it) { | 1269 ++it) { |
1271 mounts->Append(MountPointToValue(profile_, it->second)); | 1270 mounts->Append(MountPointToValue(profile_, it->second)); |
1272 } | 1271 } |
1273 #endif | 1272 #endif |
1274 | |
1275 SendResponse(true); | |
1276 return true; | |
1277 } | |
1278 | |
1279 FormatDeviceFunction::FormatDeviceFunction() { | |
1280 } | |
1281 | |
1282 FormatDeviceFunction::~FormatDeviceFunction() { | |
1283 } | |
1284 | |
1285 bool FormatDeviceFunction::RunImpl() { | |
1286 if (args_->GetSize() != 1) { | |
1287 return false; | |
1288 } | |
1289 | |
1290 std::string volume_mount_path; | |
1291 if (!args_->GetString(0, &volume_mount_path)) { | |
1292 NOTREACHED(); | |
1293 return false; | |
1294 } | |
1295 | |
1296 #ifdef OS_CHROMEOS | |
1297 chromeos::CrosLibrary::Get()->GetMountLibrary()->FormatMountedDevice( | |
1298 volume_mount_path.c_str()); | |
1299 #endif | |
1300 | |
1301 SendResponse(true); | 1273 SendResponse(true); |
1302 return true; | 1274 return true; |
1303 } | 1275 } |
1304 | 1276 |
1305 GetVolumeMetadataFunction::GetVolumeMetadataFunction() { | 1277 GetVolumeMetadataFunction::GetVolumeMetadataFunction() { |
1306 } | 1278 } |
1307 | 1279 |
1308 GetVolumeMetadataFunction::~GetVolumeMetadataFunction() { | 1280 GetVolumeMetadataFunction::~GetVolumeMetadataFunction() { |
1309 } | 1281 } |
1310 | 1282 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1446 SET_STRING(IDS_FILE_BROWSER, OPEN_LABEL); | 1418 SET_STRING(IDS_FILE_BROWSER, OPEN_LABEL); |
1447 SET_STRING(IDS_FILE_BROWSER, SAVE_LABEL); | 1419 SET_STRING(IDS_FILE_BROWSER, SAVE_LABEL); |
1448 SET_STRING(IDS_FILE_BROWSER, OK_LABEL); | 1420 SET_STRING(IDS_FILE_BROWSER, OK_LABEL); |
1449 | 1421 |
1450 SET_STRING(IDS_FILE_BROWSER, DEFAULT_NEW_FOLDER_NAME); | 1422 SET_STRING(IDS_FILE_BROWSER, DEFAULT_NEW_FOLDER_NAME); |
1451 SET_STRING(IDS_FILE_BROWSER, MORE_FILES); | 1423 SET_STRING(IDS_FILE_BROWSER, MORE_FILES); |
1452 | 1424 |
1453 SET_STRING(IDS_FILE_BROWSER, CONFIRM_DELETE_ONE); | 1425 SET_STRING(IDS_FILE_BROWSER, CONFIRM_DELETE_ONE); |
1454 SET_STRING(IDS_FILE_BROWSER, CONFIRM_DELETE_SOME); | 1426 SET_STRING(IDS_FILE_BROWSER, CONFIRM_DELETE_SOME); |
1455 | 1427 |
1456 SET_STRING(IDS_FILE_BROWSER, FORMATTING_WARNING); | |
1457 | |
1458 SET_STRING(IDS_FILE_BROWSER, SELECT_FOLDER_TITLE); | 1428 SET_STRING(IDS_FILE_BROWSER, SELECT_FOLDER_TITLE); |
1459 SET_STRING(IDS_FILE_BROWSER, SELECT_OPEN_FILE_TITLE); | 1429 SET_STRING(IDS_FILE_BROWSER, SELECT_OPEN_FILE_TITLE); |
1460 SET_STRING(IDS_FILE_BROWSER, SELECT_OPEN_MULTI_FILE_TITLE); | 1430 SET_STRING(IDS_FILE_BROWSER, SELECT_OPEN_MULTI_FILE_TITLE); |
1461 SET_STRING(IDS_FILE_BROWSER, SELECT_SAVEAS_FILE_TITLE); | 1431 SET_STRING(IDS_FILE_BROWSER, SELECT_SAVEAS_FILE_TITLE); |
1462 | 1432 |
1463 SET_STRING(IDS_FILE_BROWSER, COMPUTING_SELECTION); | 1433 SET_STRING(IDS_FILE_BROWSER, COMPUTING_SELECTION); |
1464 SET_STRING(IDS_FILE_BROWSER, NOTHING_SELECTED); | 1434 SET_STRING(IDS_FILE_BROWSER, NOTHING_SELECTED); |
1465 SET_STRING(IDS_FILE_BROWSER, ONE_FILE_SELECTED); | 1435 SET_STRING(IDS_FILE_BROWSER, ONE_FILE_SELECTED); |
1466 SET_STRING(IDS_FILE_BROWSER, ONE_DIRECTORY_SELECTED); | 1436 SET_STRING(IDS_FILE_BROWSER, ONE_DIRECTORY_SELECTED); |
1467 SET_STRING(IDS_FILE_BROWSER, MANY_FILES_SELECTED); | 1437 SET_STRING(IDS_FILE_BROWSER, MANY_FILES_SELECTED); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 #undef SET_STRING | 1469 #undef SET_STRING |
1500 | 1470 |
1501 // TODO(serya): Create a new string in .grd file for this one in M13. | 1471 // TODO(serya): Create a new string in .grd file for this one in M13. |
1502 dict->SetString("PREVIEW_IMAGE", | 1472 dict->SetString("PREVIEW_IMAGE", |
1503 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); | 1473 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); |
1504 dict->SetString("PLAY_MEDIA", | 1474 dict->SetString("PLAY_MEDIA", |
1505 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); | 1475 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); |
1506 | 1476 |
1507 return true; | 1477 return true; |
1508 } | 1478 } |
OLD | NEW |