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

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: 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
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.h ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c7b4e5e19da2f615122f7998477ac0871f31b4ca..bbc563641fa35b5ddc34756f5c1568d2d237b1e5 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -41,6 +41,8 @@
#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.h"
brettw 2011/04/28 20:43:39 You can see we've been careful to never call into
+#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/download/download_tab_helper.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/chrome_constants.h"
@@ -62,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;
@@ -1157,6 +1160,36 @@ bool RenderViewContextMenu::IsCommandIdChecked(int id) const {
(id - IDC_SPELLCHECK_LANGUAGES_FIRST);
}
+void RenderViewContextMenu::ExecuteCommandWithDisposition(
brettw 2011/04/28 20:43:39 Be sure the implementation order matches the heade
+ int id, WindowOpenDisposition disposition) {
+
+ switch (id) {
+ case IDC_BACK: {
+ Profile* profile = source_tab_contents_->profile();
+ Browser* browser =
+ BrowserList::FindBrowserWithType(profile,
+ Browser::TYPE_NORMAL, false);
+ if (browser) {
+ browser->GoBack(disposition);
+ return;
+ }
+ }
+ case IDC_FORWARD: {
+ Profile* profile = source_tab_contents_->profile();
+ Browser* browser =
+ BrowserList::FindBrowserWithType(profile,
+ Browser::TYPE_NORMAL, false);
+ if (browser) {
+ browser->GoForward(disposition);
+ 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 &&
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.h ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698