summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 17:34:58 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 17:34:58 +0000
commitcb73f9e24fdf7da411e8861ca6a1c2184569439c (patch)
tree44be79406f85261fca566ebcdc2b093ac51f9d09 /chrome
parent402e79a703cc62b290e0963a258e540b2b356a8a (diff)
downloadchromium_src-cb73f9e24fdf7da411e8861ca6a1c2184569439c.zip
chromium_src-cb73f9e24fdf7da411e8861ca6a1c2184569439c.tar.gz
chromium_src-cb73f9e24fdf7da411e8861ca6a1c2184569439c.tar.bz2
Squash the "Confirm Form Repost" dialog triggered via an external context menu reload - the dialog is modal, but there may not be anything for it to be modal to.
This is a shorter term fix - a longer term fix will be to change the way the dialog is displayed and allow it to be routed through automation. Review URL: http://codereview.chromium.org/160010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21400 0039d316-1c4b-4281-b951-d872f2087c98
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_;