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

Side by Side Diff: ui/views/focus/focus_manager.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/focus/focus_manager.h" 5 #include "ui/views/focus/focus_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 523
524 void FocusManager::AddFocusChangeListener(FocusChangeListener* listener) { 524 void FocusManager::AddFocusChangeListener(FocusChangeListener* listener) {
525 focus_change_listeners_.AddObserver(listener); 525 focus_change_listeners_.AddObserver(listener);
526 } 526 }
527 527
528 void FocusManager::RemoveFocusChangeListener(FocusChangeListener* listener) { 528 void FocusManager::RemoveFocusChangeListener(FocusChangeListener* listener) {
529 focus_change_listeners_.RemoveObserver(listener); 529 focus_change_listeners_.RemoveObserver(listener);
530 } 530 }
531 531
532 bool FocusManager::ProcessArrowKeyTraversal(const ui::KeyEvent& event) { 532 bool FocusManager::ProcessArrowKeyTraversal(const ui::KeyEvent& event) {
533 if (event.IsShiftDown() || event.IsControlDown() || event.IsAltDown()) 533 if (event.IsShiftDown() || event.IsControlDown() || event.IsAltDown() || event .IsAltGrDown())
Peter Kasting 2016/05/27 01:11:01 Nit: 80 columns
534 return false; 534 return false;
535 535
536 const int key_code = event.key_code(); 536 const int key_code = event.key_code();
537 if (key_code == ui::VKEY_LEFT || key_code == ui::VKEY_UP) { 537 if (key_code == ui::VKEY_LEFT || key_code == ui::VKEY_UP) {
538 AdvanceFocus(true); 538 AdvanceFocus(true);
539 return true; 539 return true;
540 } 540 }
541 if (key_code == ui::VKEY_RIGHT || key_code == ui::VKEY_DOWN) { 541 if (key_code == ui::VKEY_RIGHT || key_code == ui::VKEY_DOWN) {
542 AdvanceFocus(false); 542 AdvanceFocus(false);
543 return true; 543 return true;
544 } 544 }
545 545
546 return false; 546 return false;
547 } 547 }
548 548
549 bool FocusManager::IsFocusable(View* view) const { 549 bool FocusManager::IsFocusable(View* view) const {
550 DCHECK(view); 550 DCHECK(view);
551 551
552 // |keyboard_accessible_| is only used on Mac. 552 // |keyboard_accessible_| is only used on Mac.
553 #if defined(OS_MACOSX) 553 #if defined(OS_MACOSX)
554 return keyboard_accessible_ ? view->IsAccessibilityFocusable() 554 return keyboard_accessible_ ? view->IsAccessibilityFocusable()
555 : view->IsFocusable(); 555 : view->IsFocusable();
556 #else 556 #else
557 return view->IsAccessibilityFocusable(); 557 return view->IsAccessibilityFocusable();
558 #endif 558 #endif
559 } 559 }
560 560
561 } // namespace views 561 } // namespace views
OLDNEW
« ui/views/controls/textfield/textfield.cc ('K') | « ui/views/controls/textfield/textfield.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698