OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 *error = ExtensionErrorUtils::FormatErrorMessage( | 1900 *error = ExtensionErrorUtils::FormatErrorMessage( |
1901 errors::kInvalidPermission, base::IntToString(i)); | 1901 errors::kInvalidPermission, base::IntToString(i)); |
1902 return false; | 1902 return false; |
1903 } | 1903 } |
1904 | 1904 |
1905 // Only COMPONENT extensions can use the webstorePrivate and | 1905 // Only COMPONENT extensions can use the webstorePrivate and |
1906 // fileBrowserPrivate APIs. | 1906 // fileBrowserPrivate APIs. |
1907 // TODO(asargent) - We want a more general purpose mechanism for this, | 1907 // TODO(asargent) - We want a more general purpose mechanism for this, |
1908 // and better error messages. (http://crbug.com/54013) | 1908 // and better error messages. (http://crbug.com/54013) |
1909 if ((permission_str == kWebstorePrivatePermission || | 1909 if ((permission_str == kWebstorePrivatePermission || |
| 1910 permission_str == kChromeosInfoPrivatePermissions || |
1910 permission_str == kFileBrowserPrivatePermission) && | 1911 permission_str == kFileBrowserPrivatePermission) && |
1911 location_ != Extension::COMPONENT) { | 1912 (location_ != Extension::COMPONENT |
1912 continue; | 1913 #ifndef NDEBUG |
1913 } | 1914 && !CommandLine::ForCurrentProcess()->HasSwitch( |
1914 | 1915 switches::kExposePrivateExtensionApi) |
1915 if (permission_str == kChromeosInfoPrivatePermissions && | 1916 #endif |
1916 location_ != Extension::COMPONENT) { | 1917 )) { |
1917 continue; | 1918 continue; |
1918 } | 1919 } |
1919 | 1920 |
1920 // Remap the old unlimited storage permission name. | 1921 // Remap the old unlimited storage permission name. |
1921 if (permission_str == kOldUnlimitedStoragePermission) | 1922 if (permission_str == kOldUnlimitedStoragePermission) |
1922 permission_str = kUnlimitedStoragePermission; | 1923 permission_str = kUnlimitedStoragePermission; |
1923 | 1924 |
1924 if (web_extent().is_empty() || location() == Extension::COMPONENT) { | 1925 if (web_extent().is_empty() || location() == Extension::COMPONENT) { |
1925 // Check if it's a module permission. If so, enable that permission. | 1926 // Check if it's a module permission. If so, enable that permission. |
1926 if (IsAPIPermission(permission_str)) { | 1927 if (IsAPIPermission(permission_str)) { |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2558 | 2559 |
2559 UninstalledExtensionInfo::~UninstalledExtensionInfo() {} | 2560 UninstalledExtensionInfo::~UninstalledExtensionInfo() {} |
2560 | 2561 |
2561 | 2562 |
2562 UnloadedExtensionInfo::UnloadedExtensionInfo( | 2563 UnloadedExtensionInfo::UnloadedExtensionInfo( |
2563 const Extension* extension, | 2564 const Extension* extension, |
2564 Reason reason) | 2565 Reason reason) |
2565 : reason(reason), | 2566 : reason(reason), |
2566 already_disabled(false), | 2567 already_disabled(false), |
2567 extension(extension) {} | 2568 extension(extension) {} |
OLD | NEW |