| 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 #include "chrome/common/extensions/extension.h" | 5 #include "chrome/common/extensions/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/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // KEY MARKERS | 67 // KEY MARKERS |
| 68 const char kKeyBeginHeaderMarker[] = "-----BEGIN"; | 68 const char kKeyBeginHeaderMarker[] = "-----BEGIN"; |
| 69 const char kKeyBeginFooterMarker[] = "-----END"; | 69 const char kKeyBeginFooterMarker[] = "-----END"; |
| 70 const char kKeyInfoEndMarker[] = "KEY-----"; | 70 const char kKeyInfoEndMarker[] = "KEY-----"; |
| 71 const char kPublic[] = "PUBLIC"; | 71 const char kPublic[] = "PUBLIC"; |
| 72 const char kPrivate[] = "PRIVATE"; | 72 const char kPrivate[] = "PRIVATE"; |
| 73 | 73 |
| 74 const int kRSAKeySize = 1024; | 74 const int kRSAKeySize = 1024; |
| 75 | 75 |
| 76 const char kDefaultContentSecurityPolicy[] = | 76 const char kDefaultContentSecurityPolicy[] = |
| 77 "script-src 'self'; object-src 'self'"; | 77 "script-src 'self' chrome-extension-resource:; object-src 'self'"; |
| 78 | 78 |
| 79 // Converts a normal hexadecimal string into the alphabet used by extensions. | 79 // Converts a normal hexadecimal string into the alphabet used by extensions. |
| 80 // We use the characters 'a'-'p' instead of '0'-'f' to avoid ever having a | 80 // We use the characters 'a'-'p' instead of '0'-'f' to avoid ever having a |
| 81 // completely numeric host, since some software interprets that as an IP | 81 // completely numeric host, since some software interprets that as an IP |
| 82 // address. | 82 // address. |
| 83 static void ConvertHexadecimalToIDAlphabet(std::string* id) { | 83 static void ConvertHexadecimalToIDAlphabet(std::string* id) { |
| 84 for (size_t i = 0; i < id->size(); ++i) { | 84 for (size_t i = 0; i < id->size(); ++i) { |
| 85 int val; | 85 int val; |
| 86 if (base::HexStringToInt(base::StringPiece(id->begin() + i, | 86 if (base::HexStringToInt(base::StringPiece(id->begin() + i, |
| 87 id->begin() + i + 1), | 87 id->begin() + i + 1), |
| (...skipping 3467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3555 already_disabled(false), | 3555 already_disabled(false), |
| 3556 extension(extension) {} | 3556 extension(extension) {} |
| 3557 | 3557 |
| 3558 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3558 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
| 3559 const Extension* extension, | 3559 const Extension* extension, |
| 3560 const ExtensionPermissionSet* permissions, | 3560 const ExtensionPermissionSet* permissions, |
| 3561 Reason reason) | 3561 Reason reason) |
| 3562 : reason(reason), | 3562 : reason(reason), |
| 3563 extension(extension), | 3563 extension(extension), |
| 3564 permissions(permissions) {} | 3564 permissions(permissions) {} |
| OLD | NEW |