| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 return false; | 1394 return false; |
| 1395 } | 1395 } |
| 1396 | 1396 |
| 1397 // Check if it's a module permission. If so, enable that permission. | 1397 // Check if it's a module permission. If so, enable that permission. |
| 1398 if (IsAPIPermission(permission_str)) { | 1398 if (IsAPIPermission(permission_str)) { |
| 1399 api_permissions_.push_back(permission_str); | 1399 api_permissions_.push_back(permission_str); |
| 1400 continue; | 1400 continue; |
| 1401 } | 1401 } |
| 1402 | 1402 |
| 1403 // Otherwise, it's a host pattern permission. | 1403 // Otherwise, it's a host pattern permission. |
| 1404 URLPattern pattern(URLPattern::SCHEMES_ALL); | 1404 URLPattern pattern(URLPattern::SCHEME_HTTP | |
| 1405 URLPattern::SCHEME_HTTPS | |
| 1406 URLPattern::SCHEME_CHROMEUI); |
| 1405 if (!pattern.Parse(permission_str)) { | 1407 if (!pattern.Parse(permission_str)) { |
| 1406 *error = ExtensionErrorUtils::FormatErrorMessage( | 1408 *error = ExtensionErrorUtils::FormatErrorMessage( |
| 1407 errors::kInvalidPermission, IntToString(i)); | 1409 errors::kInvalidPermission, IntToString(i)); |
| 1408 return false; | 1410 return false; |
| 1409 } | 1411 } |
| 1410 | 1412 |
| 1411 if (!CanAccessURL(pattern)) { | 1413 if (!CanAccessURL(pattern)) { |
| 1412 *error = ExtensionErrorUtils::FormatErrorMessage( | 1414 *error = ExtensionErrorUtils::FormatErrorMessage( |
| 1413 errors::kInvalidPermissionScheme, IntToString(i)); | 1415 errors::kInvalidPermissionScheme, IntToString(i)); |
| 1414 return false; | 1416 return false; |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1726 } else { | 1728 } else { |
| 1727 return false; | 1729 return false; |
| 1728 } | 1730 } |
| 1729 } else { | 1731 } else { |
| 1730 return true; | 1732 return true; |
| 1731 } | 1733 } |
| 1732 } | 1734 } |
| 1733 } | 1735 } |
| 1734 return false; | 1736 return false; |
| 1735 } | 1737 } |
| OLD | NEW |