Chromium Code Reviews| Index: chrome/renderer/content_settings_observer.cc |
| diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc |
| index 7c282fbd443324f6d202ca3eb19bded649931cdf..33178c60b3938551fb036cfac6d553b50f48d6f2 100644 |
| --- a/chrome/renderer/content_settings_observer.cc |
| +++ b/chrome/renderer/content_settings_observer.cc |
| @@ -415,11 +415,8 @@ bool ContentSettingsObserver::allowReadFromClipboard(bool default_value) { |
| extensions::ScriptContext* calling_context = |
| extension_dispatcher_->script_context_set().GetCalling(); |
| if (calling_context) { |
| - const extensions::Extension* extension = |
| - calling_context->effective_extension(); |
| - allowed = extension && |
| - extension->permissions_data()->HasAPIPermission( |
| - extensions::APIPermission::kClipboardRead); |
| + allowed = calling_context->HasContentCapability( |
|
sky
2014/12/10 22:05:31
I'm not familiar enough with extension code to kno
not at google - send to devlin
2014/12/10 22:11:34
I'm not sure the code is actually right, you've lo
|
| + extensions::APIPermission::kClipboardRead); |
| } |
| #endif |
| return allowed; |
| @@ -437,11 +434,8 @@ bool ContentSettingsObserver::allowWriteToClipboard(bool default_value) { |
| extensions::Feature::BLESSED_EXTENSION_CONTEXT) { |
| allowed = true; |
| } else { |
| - const extensions::Extension* extension = |
| - calling_context->effective_extension(); |
| - allowed = extension && |
| - extension->permissions_data()->HasAPIPermission( |
| - extensions::APIPermission::kClipboardWrite); |
| + allowed = calling_context->HasContentCapability( |
| + extensions::APIPermission::kClipboardWrite); |
| } |
| } |
| #endif |