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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 if (working.length() == 0) | 241 if (working.length() == 0) |
242 return false; | 242 return false; |
243 } | 243 } |
244 | 244 |
245 return base::Base64Decode(working, output); | 245 return base::Base64Decode(working, output); |
246 } | 246 } |
247 | 247 |
248 // static | 248 // static |
249 bool Extension::ProducePEM(const std::string& input, std::string* output) { | 249 bool Extension::ProducePEM(const std::string& input, std::string* output) { |
250 DCHECK(output); | 250 DCHECK(output); |
251 return (input.length() == 0) ? false : base::Base64Encode(input, output); | 251 if (input.empty()) |
| 252 return false; |
| 253 base::Base64Encode(input, output); |
| 254 return true; |
252 } | 255 } |
253 | 256 |
254 // static | 257 // static |
255 bool Extension::FormatPEMForFileOutput(const std::string& input, | 258 bool Extension::FormatPEMForFileOutput(const std::string& input, |
256 std::string* output, | 259 std::string* output, |
257 bool is_public) { | 260 bool is_public) { |
258 DCHECK(output); | 261 DCHECK(output); |
259 if (input.length() == 0) | 262 if (input.length() == 0) |
260 return false; | 263 return false; |
261 *output = ""; | 264 *output = ""; |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 | 787 |
785 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 788 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
786 const Extension* extension, | 789 const Extension* extension, |
787 const PermissionSet* permissions, | 790 const PermissionSet* permissions, |
788 Reason reason) | 791 Reason reason) |
789 : reason(reason), | 792 : reason(reason), |
790 extension(extension), | 793 extension(extension), |
791 permissions(permissions) {} | 794 permissions(permissions) {} |
792 | 795 |
793 } // namespace extensions | 796 } // namespace extensions |
OLD | NEW |