Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1089)

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 6893046: added CTRL+Click and SHIFT+Click handler for context menu, Back and Forward. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fixed some mistakes again Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698