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 <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 file_system_dict_value->SetStringWithoutPathExpansion( | 179 file_system_dict_value->SetStringWithoutPathExpansion( |
180 kDeviceIdKey, filesystems[i].transient_device_id); | 180 kDeviceIdKey, filesystems[i].transient_device_id); |
181 } | 181 } |
182 file_system_dict_value->SetBooleanWithoutPathExpansion( | 182 file_system_dict_value->SetBooleanWithoutPathExpansion( |
183 kIsRemovableKey, filesystems[i].removable); | 183 kIsRemovableKey, filesystems[i].removable); |
184 file_system_dict_value->SetBooleanWithoutPathExpansion( | 184 file_system_dict_value->SetBooleanWithoutPathExpansion( |
185 kIsMediaDeviceKey, filesystems[i].media_device); | 185 kIsMediaDeviceKey, filesystems[i].media_device); |
186 file_system_dict_value->SetBooleanWithoutPathExpansion( | 186 file_system_dict_value->SetBooleanWithoutPathExpansion( |
187 kIsAvailableKey, true); | 187 kIsAvailableKey, true); |
188 | 188 |
189 list->Append(file_system_dict_value.release()); | 189 list->Append(std::move(file_system_dict_value)); |
190 | 190 |
191 if (filesystems[i].path.empty()) | 191 if (filesystems[i].path.empty()) |
192 continue; | 192 continue; |
193 | 193 |
194 if (has_read_permission) { | 194 if (has_read_permission) { |
195 content::ChildProcessSecurityPolicy* policy = | 195 content::ChildProcessSecurityPolicy* policy = |
196 content::ChildProcessSecurityPolicy::GetInstance(); | 196 content::ChildProcessSecurityPolicy::GetInstance(); |
197 policy->GrantReadFile(child_id, filesystems[i].path); | 197 policy->GrantReadFile(child_id, filesystems[i].path); |
198 if (has_delete_permission) { | 198 if (has_delete_permission) { |
199 policy->GrantDeleteFrom(child_id, filesystems[i].path); | 199 policy->GrantDeleteFrom(child_id, filesystems[i].path); |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 SendResponse(false); | 870 SendResponse(false); |
871 return; | 871 return; |
872 } | 872 } |
873 | 873 |
874 gallery_watch_manager()->RemoveWatch( | 874 gallery_watch_manager()->RemoveWatch( |
875 GetProfile(), extension_id(), gallery_pref_id); | 875 GetProfile(), extension_id(), gallery_pref_id); |
876 SendResponse(true); | 876 SendResponse(true); |
877 } | 877 } |
878 | 878 |
879 } // namespace extensions | 879 } // namespace extensions |
OLD | NEW |