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 // Implements the Chrome Extensions Media Galleries API. | 5 // Implements the Chrome Extensions Media Galleries API. |
6 | 6 |
7 #include "chrome/browser/extensions/api/media_galleries/media_galleries_api.h" | 7 #include "chrome/browser/extensions/api/media_galleries/media_galleries_api.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // TODO(estade): implement. | 53 // TODO(estade): implement. |
54 } else if (interactive != "no") { | 54 } else if (interactive != "no") { |
55 error_ = kInvalidInteractive; | 55 error_ = kInvalidInteractive; |
56 return false; | 56 return false; |
57 } | 57 } |
58 | 58 |
59 const content::RenderProcessHost* rph = render_view_host()->GetProcess(); | 59 const content::RenderProcessHost* rph = render_view_host()->GetProcess(); |
60 chrome::MediaFileSystemRegistry* media_fs_registry = | 60 chrome::MediaFileSystemRegistry* media_fs_registry = |
61 MediaFileSystemRegistry::GetInstance(); | 61 MediaFileSystemRegistry::GetInstance(); |
62 const std::vector<MediaFileSystemRegistry::MediaFSIDAndPath> filesystems = | 62 const std::vector<MediaFileSystemRegistry::MediaFSIDAndPath> filesystems = |
63 media_fs_registry->GetMediaFileSystems(rph); | 63 media_fs_registry->GetMediaFileSystems(rph, *GetExtension()); |
64 | 64 |
65 const int child_id = rph->GetID(); | 65 const int child_id = rph->GetID(); |
66 base::ListValue* list = new base::ListValue(); | 66 base::ListValue* list = new base::ListValue(); |
67 for (size_t i = 0; i < filesystems.size(); i++) { | 67 for (size_t i = 0; i < filesystems.size(); i++) { |
68 // TODO(thestig) Check permissions to file systems when that capability | 68 // TODO(thestig) Check permissions to file systems when that capability |
69 // exists. | 69 // exists. |
70 const MediaFileSystemRegistry::MediaFSIDAndPath& fsid_and_path = | 70 const MediaFileSystemRegistry::MediaFSIDAndPath& fsid_and_path = |
71 filesystems[i]; | 71 filesystems[i]; |
72 const std::string& fsid = fsid_and_path.first; | 72 const std::string& fsid = fsid_and_path.first; |
73 const FilePath& path = fsid_and_path.second; | 73 const FilePath& path = fsid_and_path.second; |
(...skipping 25 matching lines...) Expand all Loading... |
99 MediaGalleriesAssembleMediaFileFunction:: | 99 MediaGalleriesAssembleMediaFileFunction:: |
100 ~MediaGalleriesAssembleMediaFileFunction() {} | 100 ~MediaGalleriesAssembleMediaFileFunction() {} |
101 | 101 |
102 bool MediaGalleriesAssembleMediaFileFunction::RunImpl() { | 102 bool MediaGalleriesAssembleMediaFileFunction::RunImpl() { |
103 // TODO(vandebo) Update the metadata and return the new file. | 103 // TODO(vandebo) Update the metadata and return the new file. |
104 SetResult(Value::CreateNullValue()); | 104 SetResult(Value::CreateNullValue()); |
105 return true; | 105 return true; |
106 } | 106 } |
107 | 107 |
108 } // namespace extensions | 108 } // namespace extensions |
OLD | NEW |