OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/common/permissions/media_galleries_permission.h" | 5 #include "extensions/common/permissions/media_galleries_permission.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "extensions/common/permissions/permissions_info.h" | 12 #include "extensions/common/permissions/permissions_info.h" |
13 #include "grit/generated_resources.h" | 13 #include "grit/extensions_strings.h" |
14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // copyTo permission requires delete permission as a prerequisite. | 18 // copyTo permission requires delete permission as a prerequisite. |
19 // delete permission requires read permission as a prerequisite. | 19 // delete permission requires read permission as a prerequisite. |
20 bool IsValidPermissionSet(bool has_read, bool has_copy_to, bool has_delete, | 20 bool IsValidPermissionSet(bool has_read, bool has_copy_to, bool has_delete, |
21 std::string* error) { | 21 std::string* error) { |
22 if (has_copy_to) { | 22 if (has_copy_to) { |
23 if (has_read && has_delete) | 23 if (has_read && has_delete) |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 162 } |
163 if (has_delete) { | 163 if (has_delete) { |
164 result.push_back(PermissionMessage( | 164 result.push_back(PermissionMessage( |
165 PermissionMessage::kMediaGalleriesAllGalleriesDelete, | 165 PermissionMessage::kMediaGalleriesAllGalleriesDelete, |
166 base::string16())); | 166 base::string16())); |
167 } | 167 } |
168 return result; | 168 return result; |
169 } | 169 } |
170 | 170 |
171 } // namespace extensions | 171 } // namespace extensions |
OLD | NEW |