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

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: 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
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..8d70b71b5fbdb4dfabf803f3d16766ecce752a8a 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->HasEffectiveAPIPermission(
+ 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->HasEffectiveAPIPermission(
+ extensions::APIPermission::kClipboardWrite);
}
}
#endif

Powered by Google App Engine
This is Rietveld 408576698