summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.h4
-rw-r--r--chrome/browser/views/tab_contents/render_view_context_menu_external_win.cc16
-rw-r--r--chrome/browser/views/tab_contents/render_view_context_menu_external_win.h3
3 files changed, 21 insertions, 2 deletions
diff --git a/chrome/browser/tab_contents/render_view_context_menu.h b/chrome/browser/tab_contents/render_view_context_menu.h
index 4fc97f6..afa6861 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.h
+++ b/chrome/browser/tab_contents/render_view_context_menu.h
@@ -59,13 +59,13 @@ class RenderViewContextMenu {
// For Linux, we want to know when we have written a URL to the clipboard.
// Most platforms won't care.
- virtual void DidWriteURLToClipboard(const std::string& url) { };
+ virtual void DidWriteURLToClipboard(const std::string& url) { }
// Delegate functions --------------------------------------------------------
bool IsItemCommandEnabled(int id) const;
bool ItemIsChecked(int id) const;
- void ExecuteItemCommand(int id);
+ virtual void ExecuteItemCommand(int id);
protected:
ContextMenuParams params_;
diff --git a/chrome/browser/views/tab_contents/render_view_context_menu_external_win.cc b/chrome/browser/views/tab_contents/render_view_context_menu_external_win.cc
index f7c1dd3..b1b2316 100644
--- a/chrome/browser/views/tab_contents/render_view_context_menu_external_win.cc
+++ b/chrome/browser/views/tab_contents/render_view_context_menu_external_win.cc
@@ -6,6 +6,9 @@
#include <algorithm>
+#include "chrome/browser/tab_contents/tab_contents.h"
+#include "grit/generated_resources.h"
+
RenderViewContextMenuExternalWin::RenderViewContextMenuExternalWin(
TabContents* tab_contents,
const ContextMenuParams& params,
@@ -37,3 +40,16 @@ void RenderViewContextMenuExternalWin::DoInit() {
mi.dwMenuData = reinterpret_cast<ULONG_PTR>(this);
SetMenuInfo(menu, &mi);
}
+
+void RenderViewContextMenuExternalWin::ExecuteItemCommand(int id) {
+ switch (id) {
+ case IDS_CONTENT_CONTEXT_RELOAD:
+ // Prevent the modal "Resubmit form post" dialog from appearing in the
+ // context of an external context menu.
+ source_tab_contents_->controller().Reload(false);
+ break;
+ default:
+ RenderViewContextMenu::ExecuteItemCommand(id);
+ break;
+ }
+}
diff --git a/chrome/browser/views/tab_contents/render_view_context_menu_external_win.h b/chrome/browser/views/tab_contents/render_view_context_menu_external_win.h
index 368c70d..852adb4 100644
--- a/chrome/browser/views/tab_contents/render_view_context_menu_external_win.h
+++ b/chrome/browser/views/tab_contents/render_view_context_menu_external_win.h
@@ -26,6 +26,9 @@ class RenderViewContextMenuExternalWin : public RenderViewContextMenuWin {
// RenderViewContextMenu override
virtual void DoInit();
+ // RenderViewContextMenu override
+ virtual void ExecuteItemCommand(int id);
+
private:
// Contains the list of context menu ids to be disabled.
std::vector<int> disabled_menu_ids_;