Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(586)

Unified Diff: chrome/renderer/content_settings_observer.cc

Issue 789063002: Implement clipboardRead/Write content capabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix id generation in test Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/extensions/content_capabilities/bar.example.com.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/content_settings_observer.cc
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc
index 0f0eff8a6b54100522a5561cbe0947319b2b6b0c..1d63a8a00458630a2661ff876322ecc1710298d2 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -423,11 +423,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->HasAPIPermission(
+ extensions::APIPermission::kClipboardRead);
}
#endif
return allowed;
@@ -445,11 +442,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->HasAPIPermission(
+ extensions::APIPermission::kClipboardWrite);
}
}
#endif
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/extensions/content_capabilities/bar.example.com.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698