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 "extensions/common/extension.h" | 5 #include "extensions/common/extension.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 | 135 |
136 // static | 136 // static |
137 bool Extension::IdIsValid(const std::string& id) { | 137 bool Extension::IdIsValid(const std::string& id) { |
138 // Verify that the id is legal. | 138 // Verify that the id is legal. |
139 if (id.size() != (id_util::kIdSize * 2)) | 139 if (id.size() != (id_util::kIdSize * 2)) |
140 return false; | 140 return false; |
141 | 141 |
142 // We only support lowercase IDs, because IDs can be used as URL components | 142 // We only support lowercase IDs, because IDs can be used as URL components |
143 // (where GURL will lowercase it). | 143 // (where GURL will lowercase it). |
144 std::string temp = StringToLowerASCII(id); | 144 std::string temp = base::StringToLowerASCII(id); |
145 for (size_t i = 0; i < temp.size(); i++) | 145 for (size_t i = 0; i < temp.size(); i++) |
146 if (temp[i] < 'a' || temp[i] > 'p') | 146 if (temp[i] < 'a' || temp[i] > 'p') |
147 return false; | 147 return false; |
148 | 148 |
149 return true; | 149 return true; |
150 } | 150 } |
151 | 151 |
152 Manifest::Type Extension::GetType() const { | 152 Manifest::Type Extension::GetType() const { |
153 return converted_from_user_script() ? | 153 return converted_from_user_script() ? |
154 Manifest::TYPE_USER_SCRIPT : manifest_->type(); | 154 Manifest::TYPE_USER_SCRIPT : manifest_->type(); |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 | 779 |
780 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 780 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
781 const Extension* extension, | 781 const Extension* extension, |
782 const PermissionSet* permissions, | 782 const PermissionSet* permissions, |
783 Reason reason) | 783 Reason reason) |
784 : reason(reason), | 784 : reason(reason), |
785 extension(extension), | 785 extension(extension), |
786 permissions(permissions) {} | 786 permissions(permissions) {} |
787 | 787 |
788 } // namespace extensions | 788 } // namespace extensions |
OLD | NEW |