Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: chrome/browser/extensions/api/media_galleries/media_galleries_api.cc

Issue 185393012: Change media galleries to external file system type to add toURL support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 kIsAvailableKey, true); 169 kIsAvailableKey, true);
170 170
171 list->Append(file_system_dict_value.release()); 171 list->Append(file_system_dict_value.release());
172 172
173 if (filesystems[i].path.empty()) 173 if (filesystems[i].path.empty())
174 continue; 174 continue;
175 175
176 if (has_read_permission) { 176 if (has_read_permission) {
177 content::ChildProcessSecurityPolicy* policy = 177 content::ChildProcessSecurityPolicy* policy =
178 content::ChildProcessSecurityPolicy::GetInstance(); 178 content::ChildProcessSecurityPolicy::GetInstance();
179 policy->GrantReadFileSystem(child_id, filesystems[i].fsid); 179 policy->GrantReadFile(child_id, filesystems[i].path);
180 if (has_delete_permission) { 180 if (has_delete_permission) {
181 policy->GrantDeleteFromFileSystem(child_id, filesystems[i].fsid); 181 policy->GrantDeleteFrom(child_id, filesystems[i].path);
182 if (has_copy_to_permission) { 182 if (has_copy_to_permission) {
183 policy->GrantCopyIntoFileSystem(child_id, filesystems[i].fsid); 183 policy->GrantCopyInto(child_id, filesystems[i].path);
184 } 184 }
185 } 185 }
186 } 186 }
187 } 187 }
188 188
189 return list.release(); 189 return list.release();
190 } 190 }
191 191
192 bool CheckScanPermission(const extensions::Extension* extension, 192 bool CheckScanPermission(const extensions::Extension* extension,
193 std::string* error) { 193 std::string* error) {
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 if (!parse_success) { 835 if (!parse_success) {
836 SendResponse(false); 836 SendResponse(false);
837 return; 837 return;
838 } 838 }
839 839
840 SetResult(metadata_dictionary->DeepCopy()); 840 SetResult(metadata_dictionary->DeepCopy());
841 SendResponse(true); 841 SendResponse(true);
842 } 842 }
843 843
844 } // namespace extensions 844 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698