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/extensions/api/file_system/file_system_api.h" | 5 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 } | 290 } |
291 | 291 |
292 void SetLastChooseEntryDirectory(ExtensionPrefs* prefs, | 292 void SetLastChooseEntryDirectory(ExtensionPrefs* prefs, |
293 const std::string& extension_id, | 293 const std::string& extension_id, |
294 const base::FilePath& path) { | 294 const base::FilePath& path) { |
295 prefs->UpdateExtensionPref(extension_id, | 295 prefs->UpdateExtensionPref(extension_id, |
296 kLastChooseEntryDirectory, | 296 kLastChooseEntryDirectory, |
297 base::CreateFilePathValue(path)); | 297 base::CreateFilePathValue(path)); |
298 } | 298 } |
299 | 299 |
300 std::vector<base::FilePath> GetGrayListedDirectories() { | |
301 std::vector<base::FilePath> graylisted_directories; | |
302 for (size_t i = 0; i < arraysize(kGraylistedPaths); ++i) { | |
303 base::FilePath graylisted_path; | |
304 if (PathService::Get(kGraylistedPaths[i], &graylisted_path)) | |
305 graylisted_directories.push_back(graylisted_path); | |
306 } | |
307 return graylisted_directories; | |
308 } | |
309 | |
310 #if defined(OS_CHROMEOS) | 300 #if defined(OS_CHROMEOS) |
311 void DispatchVolumeListChangeEvent(Profile* profile) { | 301 void DispatchVolumeListChangeEvent(Profile* profile) { |
312 DCHECK(profile); | 302 DCHECK(profile); |
313 EventRouter* const event_router = EventRouter::Get(profile); | 303 EventRouter* const event_router = EventRouter::Get(profile); |
314 if (!event_router) // Possible on shutdown. | 304 if (!event_router) // Possible on shutdown. |
315 return; | 305 return; |
316 | 306 |
317 ExtensionRegistry* const registry = ExtensionRegistry::Get(profile); | 307 ExtensionRegistry* const registry = ExtensionRegistry::Get(profile); |
318 if (!registry) // Possible on shutdown. | 308 if (!registry) // Possible on shutdown. |
319 return; | 309 return; |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 using api::file_system::Volume; | 1451 using api::file_system::Volume; |
1462 std::vector<linked_ptr<Volume>> result_volume_list; | 1452 std::vector<linked_ptr<Volume>> result_volume_list; |
1463 FillVolumeList(chrome_details_.GetProfile(), &result_volume_list); | 1453 FillVolumeList(chrome_details_.GetProfile(), &result_volume_list); |
1464 | 1454 |
1465 return RespondNow(ArgumentList( | 1455 return RespondNow(ArgumentList( |
1466 api::file_system::GetVolumeList::Results::Create(result_volume_list))); | 1456 api::file_system::GetVolumeList::Results::Create(result_volume_list))); |
1467 } | 1457 } |
1468 #endif | 1458 #endif |
1469 | 1459 |
1470 } // namespace extensions | 1460 } // namespace extensions |
OLD | NEW |