summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-06 22:59:25 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-06 22:59:25 +0000
commit24346e5971aee2dbbacc62c44c39ef7d7bc1f7e1 (patch)
tree83718a675de5b5760fd2c5932f96cacd9a6235e2 /chrome/browser/gtk
parent881826004c4baacae08506d1028afb9ca548181a (diff)
downloadchromium_src-24346e5971aee2dbbacc62c44c39ef7d7bc1f7e1.zip
chromium_src-24346e5971aee2dbbacc62c44c39ef7d7bc1f7e1.tar.gz
chromium_src-24346e5971aee2dbbacc62c44c39ef7d7bc1f7e1.tar.bz2
Hook up copy pasta hotkeys in gtk bookmark manager.
Also change the display hotkey for tab reload from f5 (windowsy) to ctrl+r (linuxy). BUG=none TEST=use the new hotkeys Review URL: http://codereview.chromium.org/164097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22685 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/bookmark_manager_gtk.cc34
-rw-r--r--chrome/browser/gtk/tabs/tab_gtk.cc2
2 files changed, 32 insertions, 4 deletions
diff --git a/chrome/browser/gtk/bookmark_manager_gtk.cc b/chrome/browser/gtk/bookmark_manager_gtk.cc
index bfca0e1..19fee77 100644
--- a/chrome/browser/gtk/bookmark_manager_gtk.cc
+++ b/chrome/browser/gtk/bookmark_manager_gtk.cc
@@ -1288,12 +1288,40 @@ gboolean BookmarkManagerGtk::OnTreeViewButtonRelease(
// static
gboolean BookmarkManagerGtk::OnTreeViewKeyPress(
GtkWidget* tree_view, GdkEventKey* key, BookmarkManagerGtk* bm) {
- if (key->keyval != GDK_Delete)
+ int command = -1;
+
+ if ((key->state & gtk_accelerator_get_default_mod_mask()) ==
+ GDK_SHIFT_MASK) {
+ if (key->keyval == GDK_Delete)
+ command = IDS_CUT;
+ else if (key->keyval == GDK_Insert)
+ command = IDS_PASTE;
+ } else if ((key->state & gtk_accelerator_get_default_mod_mask()) ==
+ GDK_CONTROL_MASK) {
+ switch (key->keyval) {
+ case GDK_c:
+ case GDK_Insert:
+ command = IDS_COPY;
+ break;
+ case GDK_x:
+ command = IDS_CUT;
+ break;
+ case GDK_v:
+ command = IDS_PASTE;
+ break;
+ default:
+ break;
+ }
+ } else if (key->keyval == GDK_Delete) {
+ command = IDS_BOOKMARK_BAR_REMOVE;
+ }
+
+ if (command == -1)
return FALSE;
if (bm->organize_menu_.get() &&
- bm->organize_menu_->IsCommandEnabled(IDS_BOOKMARK_BAR_REMOVE)) {
- bm->organize_menu_->ExecuteCommand(IDS_BOOKMARK_BAR_REMOVE);
+ bm->organize_menu_->IsCommandEnabled(command)) {
+ bm->organize_menu_->ExecuteCommand(command);
return TRUE;
}
diff --git a/chrome/browser/gtk/tabs/tab_gtk.cc b/chrome/browser/gtk/tabs/tab_gtk.cc
index 3a89bf0..93bff9bc 100644
--- a/chrome/browser/gtk/tabs/tab_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_gtk.cc
@@ -34,7 +34,7 @@ class TabGtk::ContextMenuController : public MenuGtk::Delegate {
0, NULL, GDK_t, GDK_CONTROL_MASK, true },
{ MENU_SEPARATOR },
{ MENU_NORMAL, TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD,
- 0, NULL, GDK_F5, 0, true },
+ 0, NULL, GDK_r, GDK_CONTROL_MASK, true },
{ MENU_NORMAL, TabStripModel::CommandDuplicate,
IDS_TAB_CXMENU_DUPLICATE },
{ MENU_SEPARATOR },