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

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: Prefix new methods with 'web'. 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
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..707462a6952d94f5b2eb8e5c2d006bf86bcde2c9 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::IsWebCopyCutEnabled() {
+ // For backwards compatibility, extensions can always copy/cut items into the
+ // clipboard.
+ return true;
+}
+
+bool ExtensionHost::IsWebPasteEnabled() {
+ return extension_->HasApiPermission(Extension::kClipboardPermission);
+}
+
void ExtensionHost::StartDragging(const WebDropData& drop_data,
WebDragOperationsMask operation_mask,
const SkBitmap& image,

Powered by Google App Engine
This is Rietveld 408576698