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

Unified Diff: chrome/renderer/render_view.cc

Issue 165293: Supports Gtk keyboard themes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 | « chrome/renderer/render_view.h ('k') | chrome/renderer/render_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 25695)
+++ chrome/renderer/render_view.cc (working copy)
@@ -419,6 +419,8 @@
OnNotifyRendererViewType)
IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt)
IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetEditCommandsForNextKeyEvent,
+ OnSetEditCommandsForNextKeyEvent);
// Have the super handle all other messages.
IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message))
@@ -3381,3 +3383,32 @@
}
print_helper_->Print(frame, script_initiated);
}
+
+void RenderView::OnSetEditCommandsForNextKeyEvent(
+ const EditCommands& edit_commands) {
+ edit_commands_ = edit_commands;
+}
+
+void RenderView::DidHandleKeyEvent() {
+ edit_commands_.clear();
+}
+
+bool RenderView::HandleCurrentKeyboardEvent() {
+ if (edit_commands_.empty())
+ return false;
+
+ WebFrame* frame = webview()->GetFocusedFrame();
+ if (!frame)
+ return false;
+
+ EditCommands::iterator it = edit_commands_.begin();
+ EditCommands::iterator end = edit_commands_.end();
+
+ for (; it != end; ++it) {
+ if (!frame->executeCommand(WebString::fromUTF8(it->name),
+ WebString::fromUTF8(it->value)))
+ break;
+ }
+
+ return true;
+}
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698