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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2349523002: Add support for edit commands in OOPIFs. (Closed)
Patch Set: Created 4 years, 3 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 | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 4a2c71fb9966f53a248235d38088546db720cd8b..626aa7de27b6b3f0d64e42fab4d37b2b6a93f8e1 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -49,6 +49,7 @@
#include "content/common/clipboard_messages.h"
#include "content/common/content_constants_internal.h"
#include "content/common/content_security_policy_header.h"
+#include "content/common/edit_command.h"
#include "content/common/frame_messages.h"
#include "content/common/frame_owner_properties.h"
#include "content/common/frame_replication_state.h"
@@ -3787,6 +3788,21 @@ void RenderFrameImpl::didChangeSelection(bool is_empty_selection) {
SyncSelectionIfRequired();
}
+bool RenderFrameImpl::handleCurrentKeyboardEvent() {
+ bool did_execute_command = false;
+ for (auto command : GetRenderWidget()->edit_commands()) {
+ // In gtk and cocoa, it's possible to bind multiple edit commands to one
+ // key (but it's the exception). Once one edit command is not executed, it
+ // seems safest to not execute the rest.
+ if (!frame_->executeCommand(blink::WebString::fromUTF8(command.name),
+ blink::WebString::fromUTF8(command.value)))
+ break;
+ did_execute_command = true;
+ }
+
+ return did_execute_command;
+}
+
blink::WebColorChooser* RenderFrameImpl::createColorChooser(
blink::WebColorChooserClient* client,
const blink::WebColor& initial_color,
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698