summaryrefslogtreecommitdiffstats
path: root/chrome/browser
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/browser
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/browser')
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc4
-rw-r--r--chrome/browser/renderer_host/render_view_host.h3
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc6
3 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index bdda310..a227ffa 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -370,6 +370,10 @@ void RenderViewHost::Stop() {
Send(new ViewMsg_Stop(routing_id()));
}
+void RenderViewHost::ReloadFrame() {
+ Send(new ViewMsg_ReloadFrame(routing_id()));
+}
+
bool RenderViewHost::PrintPages() {
return Send(new ViewMsg_PrintPages(routing_id()));
}
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index 9a37a39..4a3966d 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -192,6 +192,9 @@ class RenderViewHost : public RenderWidgetHost {
// Stops the current load.
void Stop();
+ // Reloads the current frame.
+ void ReloadFrame();
+
// Asks the renderer to "render" printed pages and initiate printing on our
// behalf.
bool PrintPages();
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 4be28b5..aa25c83 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -215,6 +215,7 @@ void RenderViewContextMenu::AppendFrameItems() {
AppendMenuItem(IDS_CONTENT_CONTEXT_BACK);
AppendMenuItem(IDS_CONTENT_CONTEXT_FORWARD);
AppendSeparator();
+ AppendMenuItem(IDS_CONTENT_CONTEXT_RELOADFRAME);
AppendMenuItem(IDS_CONTENT_CONTEXT_OPENFRAMENEWTAB);
AppendMenuItem(IDS_CONTENT_CONTEXT_OPENFRAMENEWWINDOW);
AppendMenuItem(IDS_CONTENT_CONTEXT_OPENFRAMEOFFTHERECORD);
@@ -458,6 +459,7 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const {
(active_entry) ? active_entry->url() : GURL());
}
+ case IDS_CONTENT_CONTEXT_RELOADFRAME:
case IDS_CONTENT_CONTEXT_OPENFRAMENEWTAB:
case IDS_CONTENT_CONTEXT_OPENFRAMENEWWINDOW:
return params_.frame_url.is_valid();
@@ -695,6 +697,10 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) {
break;
}
+ case IDS_CONTENT_CONTEXT_RELOADFRAME:
+ source_tab_contents_->render_view_host()->ReloadFrame();
+ break;
+
case IDS_CONTENT_CONTEXT_OPENFRAMENEWTAB:
OpenURL(params_.frame_url, NEW_BACKGROUND_TAB, PageTransition::LINK);
break;