OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/common/extensions/permissions/media_galleries_permission_data.h
" | 5 #include "chrome/common/extensions/permissions/media_galleries_permission_data.h
" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/common/extensions/permissions/media_galleries_permission.h" | 9 #include "chrome/common/extensions/permissions/media_galleries_permission.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 return false; | 32 return false; |
33 | 33 |
34 std::string raw_permission; | 34 std::string raw_permission; |
35 if (!value->GetAsString(&raw_permission)) | 35 if (!value->GetAsString(&raw_permission)) |
36 return false; | 36 return false; |
37 | 37 |
38 std::string permission; | 38 std::string permission; |
39 TrimWhitespaceASCII(raw_permission, TRIM_ALL, &permission); | 39 TrimWhitespaceASCII(raw_permission, TRIM_ALL, &permission); |
40 | 40 |
41 if (permission == MediaGalleriesPermission::kAllAutoDetectedPermission || | 41 if (permission == MediaGalleriesPermission::kAllAutoDetectedPermission || |
42 permission == MediaGalleriesPermission::kReadPermission || | 42 permission == MediaGalleriesPermission::kReadPermission) { |
43 permission == MediaGalleriesPermission::kWritePermission) { | |
44 permission_ = permission; | 43 permission_ = permission; |
45 return true; | 44 return true; |
46 } | 45 } |
47 return false; | 46 return false; |
48 } | 47 } |
49 | 48 |
50 bool MediaGalleriesPermissionData::operator<( | 49 bool MediaGalleriesPermissionData::operator<( |
51 const MediaGalleriesPermissionData& rhs) const { | 50 const MediaGalleriesPermissionData& rhs) const { |
52 return permission_ < rhs.permission_; | 51 return permission_ < rhs.permission_; |
53 } | 52 } |
54 | 53 |
55 bool MediaGalleriesPermissionData::operator==( | 54 bool MediaGalleriesPermissionData::operator==( |
56 const MediaGalleriesPermissionData& rhs) const { | 55 const MediaGalleriesPermissionData& rhs) const { |
57 return permission_ == rhs.permission_; | 56 return permission_ == rhs.permission_; |
58 } | 57 } |
59 | 58 |
60 } // namespace extensions | 59 } // namespace extensions |
OLD | NEW |