Index: chrome/browser/tab_contents/render_view_context_menu.cc |
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc |
index 9b5e9f5517ab266de2676cc7415729fb0c7515cd..3d5ccef93e9938fefd9d96931a8fa9c8eca25f7d 100644 |
--- a/chrome/browser/tab_contents/render_view_context_menu.cc |
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc |
@@ -42,6 +42,7 @@ |
#include "chrome/browser/translate/translate_tab_helper.h" |
#include "chrome/browser/ui/download/download_tab_helper.h" |
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h" |
#include "chrome/common/chrome_constants.h" |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/pref_names.h" |
@@ -63,6 +64,7 @@ |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/gfx/favicon_size.h" |
#include "webkit/glue/webmenuitem.h" |
+#include "webkit/glue/window_open_disposition.h" |
using WebKit::WebContextMenuData; |
using WebKit::WebMediaPlayerAction; |
@@ -1507,6 +1509,32 @@ void RenderViewContextMenu::ExecuteCommand(int id) { |
} |
} |
+void RenderViewContextMenu::ExecuteCommandWithDisposition( |
+ int id, int disposition) { |
+ |
+ switch (id) { |
+ case IDC_BACK: { |
+ TabContentsWrapper* wrapper = |
+ TabContentsWrapper::GetCurrentWrapperForContents( |
+ source_tab_contents_); |
+ wrapper->delegate()->GoBack( |
+ static_cast<WindowOpenDisposition>(disposition)); |
+ return; |
+ } |
+ case IDC_FORWARD: { |
+ TabContentsWrapper* wrapper = |
+ TabContentsWrapper::GetCurrentWrapperForContents( |
+ source_tab_contents_); |
+ wrapper->delegate()->GoForward( |
+ static_cast<WindowOpenDisposition>(disposition)); |
+ return; |
+ } |
+ } |
+ |
+ // If not processed, call ExecuteCommand instead. |
+ ExecuteCommand(id); |
+} |
+ |
void RenderViewContextMenu::MenuWillShow() { |
RenderWidgetHostView* view = source_tab_contents_->GetRenderWidgetHostView(); |
if (view) |