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

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: make event_utils::DispositionFromEventFlags not view-specific. Created 9 years, 7 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 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 &&

Powered by Google App Engine
This is Rietveld 408576698