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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2287803002: Add support for edit commands in OOPIFs. (Closed)
Patch Set: Remove WebFrameClient null checks 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 353ac6c477fdf1fbb25e33c37c7781994a82c496..c12ca131edd26cc45c61393850b190415fb38dbd 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"
@@ -3774,6 +3775,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