diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 23:26:40 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 23:26:40 +0000 |
commit | af34e6cd862c0ef241c66687e0f88ffccf2c9044 (patch) | |
tree | ec574c2e6547943b490783aa5aae705a6cc4c92b /chrome | |
parent | 75d69a0d6ae1ecbfdc2eed35d1542af89ed2e069 (diff) | |
download | chromium_src-af34e6cd862c0ef241c66687e0f88ffccf2c9044.zip chromium_src-af34e6cd862c0ef241c66687e0f88ffccf2c9044.tar.gz chromium_src-af34e6cd862c0ef241c66687e0f88ffccf2c9044.tar.bz2 |
The ShelfItemDialog has an accelerator for Enter.
Since it also had a default button (that would also register an accelerator for Enter), there would be an assertion failure when unregistering the first accelerator.
Also removed the Esc accelerator (it is already handled by the dialog by default).
BUG=12922
TEST=Repro the scenario described in bug.
Review URL: http://codereview.chromium.org/115956
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17260 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/shelf_item_dialog.cc | 7 | ||||
-rw-r--r-- | chrome/browser/views/shelf_item_dialog.h | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/views/shelf_item_dialog.cc b/chrome/browser/views/shelf_item_dialog.cc index 74f8329..0b68634 100644 --- a/chrome/browser/views/shelf_item_dialog.cc +++ b/chrome/browser/views/shelf_item_dialog.cc @@ -340,7 +340,6 @@ ShelfItemDialog::ShelfItemDialog(ShelfItemDialogDelegate* delegate, layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - AddAccelerator(views::Accelerator(VK_ESCAPE, false, false, false)); AddAccelerator(views::Accelerator(VK_RETURN, false, false, false)); } @@ -438,6 +437,12 @@ bool ShelfItemDialog::Accept() { return true; } +int ShelfItemDialog::GetDefaultDialogButton() const { + // Don't set a default button, this view already has an accelerator for the + // enter key. + return MessageBoxFlags::DIALOGBUTTON_NONE; +} + bool ShelfItemDialog::IsDialogButtonEnabled( MessageBoxFlags::DialogButton button) const { if (button == MessageBoxFlags::DIALOGBUTTON_OK) diff --git a/chrome/browser/views/shelf_item_dialog.h b/chrome/browser/views/shelf_item_dialog.h index 78088fe6..73a85ef 100644 --- a/chrome/browser/views/shelf_item_dialog.h +++ b/chrome/browser/views/shelf_item_dialog.h @@ -62,7 +62,9 @@ class ShelfItemDialog : public views::View, virtual std::wstring GetDialogButtonLabel( MessageBoxFlags::DialogButton button) const; virtual bool Accept(); - virtual bool IsDialogButtonEnabled(MessageBoxFlags::DialogButton button) const; + virtual int GetDefaultDialogButton() const; + virtual bool IsDialogButtonEnabled( + MessageBoxFlags::DialogButton button) const; virtual views::View* GetContentsView(); // TextField::Controller. |