summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/views/bookmark_manager_view.cc11
-rw-r--r--chrome/browser/views/bookmark_manager_view.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/views/bookmark_manager_view.cc b/chrome/browser/views/bookmark_manager_view.cc
index eb0e3d3..761f34c 100644
--- a/chrome/browser/views/bookmark_manager_view.cc
+++ b/chrome/browser/views/bookmark_manager_view.cc
@@ -206,6 +206,9 @@ BookmarkManagerView::BookmarkManagerView(Profile* profile)
layout->StartRow(1, split_cs_id);
layout->AddView(split_view_);
+ // Press Ctrl-W to close bookmark manager window.
+ AddAccelerator(views::Accelerator('W', false, true, false));
+
BookmarkModel* bookmark_model = profile_->GetBookmarkModel();
if (!bookmark_model->IsLoaded())
bookmark_model->AddObserver(this);
@@ -340,6 +343,14 @@ void BookmarkManagerView::WindowClosing() {
prefs::kBookmarkManagerSplitLocation, split_view_->divider_x());
}
+bool BookmarkManagerView::AcceleratorPressed(
+ const views::Accelerator& accelerator) {
+ // Ctrl-W to close bookmark manager.
+ DCHECK(accelerator.GetKeyCode() == 'W' && accelerator.IsCtrlDown());
+ window()->Close();
+ return true;
+}
+
void BookmarkManagerView::OnDoubleClick() {
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 710363a..814f3a6 100644
--- a/chrome/browser/views/bookmark_manager_view.h
+++ b/chrome/browser/views/bookmark_manager_view.h
@@ -93,6 +93,10 @@ class BookmarkManagerView : public views::View,
Profile* profile() const { return profile_; }
+ protected:
+ // View methods.
+ virtual bool AcceleratorPressed(const views::Accelerator& accelerator);
+
private:
// TableViewObserver methods.
virtual void OnSelectionChanged() {}