summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-28 18:24:56 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-28 18:24:56 +0000
commit1dda4022a94ea32b79de8880541bce53d30a89a7 (patch)
tree7d6eb946ae1c1dd0d8f2d3b6798615d6bcdecdea /chrome/renderer
parent468d0a051ed14b487321ff3535f2adc9b47f62a1 (diff)
downloadchromium_src-1dda4022a94ea32b79de8880541bce53d30a89a7.zip
chromium_src-1dda4022a94ea32b79de8880541bce53d30a89a7.tar.gz
chromium_src-1dda4022a94ea32b79de8880541bce53d30a89a7.tar.bz2
Added a "Reload Frame" command to context menu of a frame in the html page.
It was nessessary to add a IPC Message with no Paramter for the reload frame request to the webkit renderer and to add a menu string. The command should only reload the frame clicked in for opening the context menu and let the other parts of the webpage unmodified and unrefreshed. BUG=3858 TEST=Try to click on "Reload Frame" in the context menu of a frame and see if that frame reloads. Review URL: http://codereview.chromium.org/552126 Patch from alexander@sulfrian.net. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37414 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/render_view.cc7
-rw-r--r--chrome/renderer/render_view.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 4c74a61..ce5520b 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -472,6 +472,7 @@ void RenderView::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewMsg_PrintingDone, OnPrintingDone)
IPC_MESSAGE_HANDLER(ViewMsg_Navigate, OnNavigate)
IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop)
+ IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame)
IPC_MESSAGE_HANDLER(ViewMsg_LoadAlternateHTMLText, OnLoadAlternateHTMLText)
IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding)
IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo)
@@ -889,6 +890,12 @@ void RenderView::OnStop() {
webview()->mainFrame()->stopLoading();
}
+// Reload current focused frame
+void RenderView::OnReloadFrame() {
+ if (webview() && webview()->focusedFrame())
+ webview()->focusedFrame()->reload();
+}
+
void RenderView::OnLoadAlternateHTMLText(const std::string& html,
bool new_navigation,
const GURL& display_url,
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index d1b4989..2845601 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -547,6 +547,7 @@ class RenderView : public RenderWidget,
void OnPrintingDone(int document_cookie, bool success);
void OnNavigate(const ViewMsg_Navigate_Params& params);
void OnStop();
+ void OnReloadFrame();
void OnLoadAlternateHTMLText(const std::string& html_contents,
bool new_navigation,
const GURL& display_url,