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 c61ee4c0e4a5beaa8e1ea422f5d8eeb8c63063d9..b2d2da68f817e2b9efc3130ded920edc44eb9ba7 100644 |
--- a/chrome/browser/tab_contents/render_view_context_menu.cc |
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc |
@@ -40,8 +40,10 @@ |
#include "chrome/browser/translate/translate_manager.h" |
#include "chrome/browser/translate/translate_prefs.h" |
#include "chrome/browser/translate/translate_tab_helper.h" |
+#include "chrome/browser/ui/browser_back_forward_navigator.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 +65,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; |
@@ -1198,6 +1201,30 @@ bool RenderViewContextMenu::IsCommandIdChecked(int id) const { |
(id - IDC_SPELLCHECK_LANGUAGES_FIRST); |
} |
+void RenderViewContextMenu::ExecuteCommandWithFlags(int id, int flags) { |
+ switch (id) { |
+ case IDC_BACK: { |
Ben Goodger (Google)
2011/05/31 16:00:00
A general note. It seems weird to me that the cont
shinyak (Google)
2011/06/09 02:29:04
I've changed these so that they just call a functi
|
+ TabContentsWrapper* wrapper = |
+ TabContentsWrapper::GetCurrentWrapperForContents( |
+ source_tab_contents_); |
+ browser::BrowserBackForwardNavigator::GoBack( |
+ wrapper->delegate(), flags); |
+ return; |
+ } |
+ case IDC_FORWARD: { |
+ TabContentsWrapper* wrapper = |
+ TabContentsWrapper::GetCurrentWrapperForContents( |
+ source_tab_contents_); |
+ browser::BrowserBackForwardNavigator::GoForward( |
+ wrapper->delegate(), flags); |
+ return; |
+ } |
+ } |
+ |
+ // If not processed, call ExecuteCommand instead. |
+ ExecuteCommand(id); |
+} |
+ |
void RenderViewContextMenu::ExecuteCommand(int id) { |
// Check to see if one of the spell check language ids have been clicked. |
if (id >= IDC_SPELLCHECK_LANGUAGES_FIRST && |