diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 18:15:16 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 18:15:16 +0000 |
commit | 03ce2f5bf335b39ad24306a3a962823e46305cc4 (patch) | |
tree | 31dec38ccbc8f8a082020a6c2196aa288b492cce /chrome | |
parent | 0f92d1d1aca69b365685da5e0aa8e2bc315a0694 (diff) | |
download | chromium_src-03ce2f5bf335b39ad24306a3a962823e46305cc4.zip chromium_src-03ce2f5bf335b39ad24306a3a962823e46305cc4.tar.gz chromium_src-03ce2f5bf335b39ad24306a3a962823e46305cc4.tar.bz2 |
Middle clicking on a bookmark from the bookmark manager now
opens that bookmark in a new foreground tab.
http://crbug.com/7788
Checked in for Meelap Shah
Original review = http://codereview.chromium.org/115665
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16760 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/bookmark_manager_view.cc | 13 | ||||
-rw-r--r-- | chrome/browser/views/bookmark_manager_view.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/views/bookmark_manager_view.cc b/chrome/browser/views/bookmark_manager_view.cc index 25cddc0..a66c105 100644 --- a/chrome/browser/views/bookmark_manager_view.cc +++ b/chrome/browser/views/bookmark_manager_view.cc @@ -347,6 +347,19 @@ void BookmarkManagerView::OnDoubleClick() { GetWidget()->GetNativeView(), profile_, NULL, nodes, CURRENT_TAB); } +void BookmarkManagerView::OnMiddleClick() { + std::vector<BookmarkNode*> nodes = GetSelectedTableNodes(); + if (nodes.empty()) + return; + if (nodes.size() == 1 && nodes[0]->is_folder()) { + // Middle clicking on a folder results in no action. + return; + } + + bookmark_utils::OpenAll( + GetWidget()->GetNativeView(), profile_, NULL, nodes, NEW_FOREGROUND_TAB); +} + void BookmarkManagerView::OnTableViewDelete(views::TableView* table) { std::vector<BookmarkNode*> nodes = GetSelectedTableNodes(); if (nodes.empty()) diff --git a/chrome/browser/views/bookmark_manager_view.h b/chrome/browser/views/bookmark_manager_view.h index 3c73375..710363a 100644 --- a/chrome/browser/views/bookmark_manager_view.h +++ b/chrome/browser/views/bookmark_manager_view.h @@ -98,6 +98,7 @@ class BookmarkManagerView : public views::View, virtual void OnSelectionChanged() {} // Overriden to open the selected table nodes in the current browser. virtual void OnDoubleClick(); + virtual void OnMiddleClick(); virtual void OnTableViewDelete(views::TableView* table); virtual void OnKeyDown(unsigned short virtual_keycode); |