Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: ui/views/controls/tree/tree_view.cc

Issue 14230018: Handle dialog acclerators explicitly; nix default button switching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Limit the focused view handling to LabelButton; update tests. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/tree/tree_view.cc
diff --git a/ui/views/controls/tree/tree_view.cc b/ui/views/controls/tree/tree_view.cc
index 34d65617cf12ae1ab43db3f2820910b052ec1e99..25c09b5adc569d5d8ac0767c8860dacb45748140 100644
--- a/ui/views/controls/tree/tree_view.cc
+++ b/ui/views/controls/tree/tree_view.cc
@@ -353,14 +353,15 @@ gfx::Size TreeView::GetPreferredSize() {
}
bool TreeView::AcceleratorPressed(const ui::Accelerator& accelerator) {
- if (accelerator.key_code() == ui::VKEY_RETURN) {
+ if (accelerator.key_code() == ui::VKEY_RETURN && editing_) {
CommitEdit();
- } else {
- DCHECK_EQ(ui::VKEY_ESCAPE, accelerator.key_code());
+ return true;
+ } else if (accelerator.key_code() == ui::VKEY_ESCAPE) {
CancelEdit();
RequestFocus();
+ return true;
}
- return true;
+ return false;
}
bool TreeView::OnMousePressed(const ui::MouseEvent& event) {
« no previous file with comments | « no previous file | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698