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

Side by Side Diff: ui/views/controls/combobox/combobox.cc

Issue 2013293002: NOT FOR COMMIT: Make altgr+left and altgr+right navigate back/forward on views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/combobox/combobox.h" 5 #include "ui/views/controls/combobox/combobox.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 return gfx::Size(total_width, content_size_.height() + insets.height()); 533 return gfx::Size(total_width, content_size_.height() + insets.height());
534 } 534 }
535 535
536 const char* Combobox::GetClassName() const { 536 const char* Combobox::GetClassName() const {
537 return kViewClassName; 537 return kViewClassName;
538 } 538 }
539 539
540 bool Combobox::SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) { 540 bool Combobox::SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) {
541 // Escape should close the drop down list when it is active, not host UI. 541 // Escape should close the drop down list when it is active, not host UI.
542 if (e.key_code() != ui::VKEY_ESCAPE || 542 if (e.key_code() != ui::VKEY_ESCAPE ||
543 e.IsShiftDown() || e.IsControlDown() || e.IsAltDown()) { 543 e.IsShiftDown() || e.IsControlDown() || e.IsAltDown() || e.IsAltGrDown()) {
Peter Kasting 2016/05/27 01:11:01 Nit: 80 columns
544 return false; 544 return false;
545 } 545 }
546 return !!menu_runner_; 546 return !!menu_runner_;
547 } 547 }
548 548
549 bool Combobox::OnKeyPressed(const ui::KeyEvent& e) { 549 bool Combobox::OnKeyPressed(const ui::KeyEvent& e) {
550 // TODO(oshima): handle IME. 550 // TODO(oshima): handle IME.
551 DCHECK_EQ(e.type(), ui::ET_KEY_PRESSED); 551 DCHECK_EQ(e.type(), ui::ET_KEY_PRESSED);
552 552
553 DCHECK_GE(selected_index_, 0); 553 DCHECK_GE(selected_index_, 0);
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 897
898 int Combobox::GetArrowContainerWidth() const { 898 int Combobox::GetArrowContainerWidth() const {
899 const int kNormalPadding = 7; 899 const int kNormalPadding = 7;
900 int padding = style_ == STYLE_NORMAL 900 int padding = style_ == STYLE_NORMAL
901 ? kNormalPadding * 2 901 ? kNormalPadding * 2
902 : kActionLeftPadding + kActionRightPadding; 902 : kActionLeftPadding + kActionRightPadding;
903 return ArrowSize().width() + padding; 903 return ArrowSize().width() + padding;
904 } 904 }
905 905
906 } // namespace views 906 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698