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

Unified Diff: chrome/browser/extensions/extension_host.cc

Issue 6480106: Add IPCs to check web copy/cut/paste for extensions with the appropriate permission bit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: Created 9 years, 10 months 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/browser/extensions/extension_host.h ('k') | chrome/browser/notifications/balloon_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_host.cc
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index 74ca03287af1b8b67085dbe5156025f093dc2bc3..6c72d0ce9db8ac478d6455fb00e6d0193731127b 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -515,12 +515,6 @@ WebPreferences ExtensionHost::GetWebkitPrefs() {
webkit_prefs.accelerated_2d_canvas_enabled = false;
}
- // TODO(dcheng): incorporate this setting into kClipboardPermission check.
- webkit_prefs.javascript_can_access_clipboard = true;
-
- // TODO(dcheng): check kClipboardPermission instead once it's implemented.
- if (extension_->HasApiPermission(Extension::kExperimentalPermission))
- webkit_prefs.dom_paste_enabled = true;
return webkit_prefs;
}
@@ -670,6 +664,16 @@ void ExtensionHost::ShowPopupMenu(const gfx::Rect& bounds,
#endif
}
+bool ExtensionHost::IsCopyCutEnabled() {
+ // For backwards compatibility, extensions can always copy/cut items into the
+ // clipboard.
+ return true;
+}
+
+bool ExtensionHost::IsPasteEnabled() {
+ return extension_->HasApiPermission(Extension::kClipboardPermission);
rniwa-cr 2011/02/16 03:41:50 Is extension_ origin controlled? i.e. only script
+}
+
void ExtensionHost::StartDragging(const WebDropData& drop_data,
WebDragOperationsMask operation_mask,
const SkBitmap& image,
« no previous file with comments | « chrome/browser/extensions/extension_host.h ('k') | chrome/browser/notifications/balloon_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698