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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 222783004: Move textual replacement to WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/render_widget_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index e00498e4bbb2bd2b30aaec079588038cdafe1b54..ab4cde80bee1bd670791f1daab6ac51d35f11843 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -51,6 +51,7 @@
#include "content/common/browser_plugin/browser_plugin_messages.h"
#include "content/common/frame_messages.h"
#include "content/common/image_messages.h"
+#include "content/common/input_messages.h"
#include "content/common/ssl_status_serialization.h"
#include "content/common/view_messages.h"
#include "content/port/browser/render_view_host_delegate_view.h"
@@ -1775,7 +1776,27 @@ void WebContentsImpl::SetHistoryLengthAndPrune(
}
void WebContentsImpl::ReloadFocusedFrame(bool ignore_cache) {
- Send(new FrameMsg_Reload(GetFocusedFrame()->GetRoutingID(), ignore_cache));
+ RenderFrameHost* focused_frame = GetFocusedFrame();
+ if (!focused_frame)
+ return;
+
+ Send(new FrameMsg_Reload(focused_frame->GetRoutingID(), ignore_cache));
+}
+
+void WebContentsImpl::Replace(const base::string16& word) {
+ RenderFrameHost* focused_frame = GetFocusedFrame();
+ if (!focused_frame)
+ return;
+
+ Send(new InputMsg_Replace(focused_frame->GetRoutingID(), word));
+}
+
+void WebContentsImpl::ReplaceMisspelling(const base::string16& word) {
+ RenderFrameHost* focused_frame = GetFocusedFrame();
+ if (!focused_frame)
+ return;
+
+ Send(new InputMsg_ReplaceMisspelling(focused_frame->GetRoutingID(), word));
}
void WebContentsImpl::FocusThroughTabTraversal(bool reverse) {
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/render_widget_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698