| 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 "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2312 | 2312 |
| 2313 bool Extension::HasEffectiveAccessToAllHosts() const { | 2313 bool Extension::HasEffectiveAccessToAllHosts() const { |
| 2314 return HasEffectiveAccessToAllHosts(GetEffectiveHostPermissions(), | 2314 return HasEffectiveAccessToAllHosts(GetEffectiveHostPermissions(), |
| 2315 api_permissions()); | 2315 api_permissions()); |
| 2316 } | 2316 } |
| 2317 | 2317 |
| 2318 bool Extension::HasFullPermissions() const { | 2318 bool Extension::HasFullPermissions() const { |
| 2319 return plugins().size() > 0; | 2319 return plugins().size() > 0; |
| 2320 } | 2320 } |
| 2321 | 2321 |
| 2322 bool Extension::ShowConfigureContextMenus() const { |
| 2323 // Don't show context menu for component extensions. We might want to show |
| 2324 // options for component extension button but now there is no component |
| 2325 // extension with options. All other menu items like uninstall have |
| 2326 // no sense for component extensions. |
| 2327 return location() != Extension::COMPONENT; |
| 2328 } |
| 2329 |
| 2322 bool Extension::IsAPIPermission(const std::string& str) const { | 2330 bool Extension::IsAPIPermission(const std::string& str) const { |
| 2323 for (size_t i = 0; i < Extension::kNumPermissions; ++i) { | 2331 for (size_t i = 0; i < Extension::kNumPermissions; ++i) { |
| 2324 if (str == Extension::kPermissions[i].name) { | 2332 if (str == Extension::kPermissions[i].name) { |
| 2325 return true; | 2333 return true; |
| 2326 } | 2334 } |
| 2327 } | 2335 } |
| 2328 return false; | 2336 return false; |
| 2329 } | 2337 } |
| 2330 | 2338 |
| 2331 bool Extension::CanExecuteScriptEverywhere() const { | 2339 bool Extension::CanExecuteScriptEverywhere() const { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2372 | 2380 |
| 2373 UninstalledExtensionInfo::~UninstalledExtensionInfo() {} | 2381 UninstalledExtensionInfo::~UninstalledExtensionInfo() {} |
| 2374 | 2382 |
| 2375 | 2383 |
| 2376 UnloadedExtensionInfo::UnloadedExtensionInfo( | 2384 UnloadedExtensionInfo::UnloadedExtensionInfo( |
| 2377 const Extension* extension, | 2385 const Extension* extension, |
| 2378 Reason reason) | 2386 Reason reason) |
| 2379 : reason(reason), | 2387 : reason(reason), |
| 2380 already_disabled(false), | 2388 already_disabled(false), |
| 2381 extension(extension) {} | 2389 extension(extension) {} |
| OLD | NEW |