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

Unified Diff: content/renderer/render_view_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_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index c544c288f698925f521d0de4f33c0d96cafead94..4513fdd653df86cce6749b766571eebd2e6d4846 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1261,10 +1261,6 @@ bool RenderViewImpl::DoesRenderWidgetHaveTouchEventHandlersAt(
return webview()->hasTouchEventHandlersAt(point);
}
-void RenderViewImpl::RenderWidgetDidHandleKeyEvent() {
- ClearEditCommands();
-}
-
bool RenderViewImpl::RenderWidgetWillHandleGestureEvent(
const blink::WebGestureEvent& event) {
possible_drag_event_info_.event_source =
@@ -1310,8 +1306,6 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret)
IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect,
OnScrollFocusedEditableNodeIntoRect)
- IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent,
- OnSetEditCommandsForNextKeyEvent)
IPC_MESSAGE_HANDLER(ViewMsg_SetPageScale, OnSetPageScale)
IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom)
IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL,
@@ -1434,11 +1428,6 @@ void RenderViewImpl::OnScrollFocusedEditableNodeIntoRect(
GetWidget()->FocusChangeComplete();
}
-void RenderViewImpl::OnSetEditCommandsForNextKeyEvent(
- const EditCommands& edit_commands) {
- edit_commands_ = edit_commands;
-}
-
void RenderViewImpl::OnSetHistoryOffsetAndLength(int history_offset,
int history_length) {
DCHECK_GE(history_offset, -1);
@@ -1677,29 +1666,6 @@ void RenderViewImpl::didCancelCompositionOnSelectionChange() {
Send(new InputHostMsg_ImeCancelComposition(GetRoutingID()));
}
-bool RenderViewImpl::handleCurrentKeyboardEvent() {
- if (edit_commands_.empty())
- return false;
-
- WebLocalFrame* frame = webview()->focusedFrame();
-
- EditCommands::iterator it = edit_commands_.begin();
- EditCommands::iterator end = edit_commands_.end();
-
- bool did_execute_command = false;
- for (; it != end; ++it) {
- // 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(WebString::fromUTF8(it->name),
- WebString::fromUTF8(it->value)))
- break;
- did_execute_command = true;
- }
-
- return did_execute_command;
-}
-
void RenderViewImpl::SetValidationMessageDirection(
base::string16* wrapped_main_text,
blink::WebTextDirection main_text_hint,
@@ -2102,13 +2068,11 @@ void RenderViewImpl::Repaint(const gfx::Size& size) {
void RenderViewImpl::SetEditCommandForNextKeyEvent(const std::string& name,
const std::string& value) {
- EditCommands edit_commands;
- edit_commands.push_back(EditCommand(name, value));
- OnSetEditCommandsForNextKeyEvent(edit_commands);
+ GetWidget()->SetEditCommandForNextKeyEvent(name, value);
}
void RenderViewImpl::ClearEditCommands() {
- edit_commands_.clear();
+ GetWidget()->ClearEditCommands();
}
const std::string& RenderViewImpl::GetAcceptLanguages() const {
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698