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

Unified Diff: chrome/browser/gtk/browser_titlebar.cc

Issue 159721: GTK: Show shortcuts in title bar context menu and tab context menu.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 | « no previous file | chrome/browser/gtk/browser_window_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/browser_titlebar.cc
===================================================================
--- chrome/browser/gtk/browser_titlebar.cc (revision 22106)
+++ chrome/browser/gtk/browser_titlebar.cc (working copy)
@@ -4,6 +4,7 @@
#include "chrome/browser/gtk/browser_titlebar.h"
+#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <string>
@@ -15,7 +16,9 @@
#include "chrome/browser/browser.h"
#include "chrome/browser/gtk/browser_window_gtk.h"
#include "chrome/browser/gtk/custom_button.h"
+#include "chrome/browser/gtk/menu_gtk.h"
#include "chrome/browser/gtk/nine_box.h"
+#include "chrome/browser/gtk/standard_menus.h"
#include "chrome/browser/gtk/tabs/tab_strip_gtk.h"
#include "chrome/browser/profile.h"
#include "chrome/common/pref_names.h"
@@ -242,25 +245,21 @@
void BrowserTitlebar::ShowContextMenu() {
if (!context_menu_.get()) {
- context_menu_.reset(new MenuGtk(this, false));
- context_menu_->AppendMenuItemWithLabel(
- IDC_NEW_TAB,
- l10n_util::GetStringUTF8(IDS_TAB_CXMENU_NEWTAB));
- context_menu_->AppendMenuItemWithLabel(
- IDC_RESTORE_TAB,
- l10n_util::GetStringUTF8(IDS_RESTORE_TAB));
+ static const MenuCreateMaterial context_menu_blueprint[] = {
+ { MENU_NORMAL, IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB, 0, NULL,
+ GDK_t, GDK_CONTROL_MASK, true },
+ { MENU_NORMAL, IDC_RESTORE_TAB, IDS_RESTORE_TAB, 0, NULL,
+ GDK_t, GDK_CONTROL_MASK | GDK_SHIFT_MASK, true },
+ { MENU_SEPARATOR },
+ { MENU_NORMAL, IDC_TASK_MANAGER, IDS_TASK_MANAGER, 0, NULL,
+ GDK_Escape, GDK_SHIFT_MASK, true },
+ { MENU_SEPARATOR },
+ { MENU_CHECKBOX, kShowWindowDecorationsCommand,
+ IDS_SHOW_WINDOW_DECORATIONS },
+ { MENU_END },
+ };
- context_menu_->AppendSeparator();
-
- context_menu_->AppendMenuItemWithLabel(
- IDC_TASK_MANAGER,
- l10n_util::GetStringUTF8(IDS_TASK_MANAGER));
-
- context_menu_->AppendSeparator();
-
- context_menu_->AppendCheckMenuItemWithLabel(
- kShowWindowDecorationsCommand,
- l10n_util::GetStringUTF8(IDS_SHOW_WINDOW_DECORATIONS));
+ context_menu_.reset(new MenuGtk(this, context_menu_blueprint, NULL));
}
context_menu_->PopupAsContext(gtk_get_current_event_time());
« no previous file with comments | « no previous file | chrome/browser/gtk/browser_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698