summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-27 14:34:22 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-27 14:34:22 +0000
commit4079724701312d23a68a148158c8024f0433fbd8 (patch)
tree3cea3b0f3e028c3f2af3fa79fdc8ca149f3ab61b
parent449dd2fa0f79ea68566f04399b3860b59762bc62 (diff)
downloadchromium_src-4079724701312d23a68a148158c8024f0433fbd8.zip
chromium_src-4079724701312d23a68a148158c8024f0433fbd8.tar.gz
chromium_src-4079724701312d23a68a148158c8024f0433fbd8.tar.bz2
Lands http://codereview.chromium.org/115505 for bug
http://crbug.com/4030 for tyoshino. BUG=http://crbug.com/4030 TEST=make sure control-w dismisses bookmark manager. Review URL: http://codereview.chromium.org/113887 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16982 0039d316-1c4b-4281-b951-d872f2087c98
-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() {}