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

Side by Side Diff: ash/accelerators/accelerator_controller.cc

Issue 11580005: Don't fire Alt-Search binding when Alt-Search is being used for accessing a modifer key. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 10
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 // If something else was pressed between the Shift key being pressed 576 // If something else was pressed between the Shift key being pressed
577 // and released, then ignore the release of the Shift key. 577 // and released, then ignore the release of the Shift key.
578 return false; 578 return false;
579 } 579 }
580 if (shell->caps_lock_delegate()->IsCapsLockEnabled()) { 580 if (shell->caps_lock_delegate()->IsCapsLockEnabled()) {
581 shell->caps_lock_delegate()->SetCapsLockEnabled(false); 581 shell->caps_lock_delegate()->SetCapsLockEnabled(false);
582 return true; 582 return true;
583 } 583 }
584 return false; 584 return false;
585 case TOGGLE_CAPS_LOCK: 585 case TOGGLE_CAPS_LOCK:
586 if (key_code == ui::VKEY_LWIN) {
587 // If something else was pressed between the Search key (LWIN)
588 // being pressed and released, then ignore the release of the
589 // Search key.
590 // TODO(danakj): Releasing Alt first breaks this: crbug.com/166495
591 if (previous_event_type == ui::ET_KEY_RELEASED ||
592 previous_key_code != ui::VKEY_LWIN)
593 return false;
594 }
586 shell->caps_lock_delegate()->ToggleCapsLock(); 595 shell->caps_lock_delegate()->ToggleCapsLock();
587 return true; 596 return true;
588 case BRIGHTNESS_DOWN: 597 case BRIGHTNESS_DOWN:
589 if (brightness_control_delegate_.get()) 598 if (brightness_control_delegate_.get())
590 return brightness_control_delegate_->HandleBrightnessDown(accelerator); 599 return brightness_control_delegate_->HandleBrightnessDown(accelerator);
591 break; 600 break;
592 case BRIGHTNESS_UP: 601 case BRIGHTNESS_UP:
593 if (brightness_control_delegate_.get()) 602 if (brightness_control_delegate_.get())
594 return brightness_control_delegate_->HandleBrightnessUp(accelerator); 603 return brightness_control_delegate_->HandleBrightnessUp(accelerator);
595 break; 604 break;
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 keyboard_brightness_control_delegate) { 860 keyboard_brightness_control_delegate) {
852 keyboard_brightness_control_delegate_ = 861 keyboard_brightness_control_delegate_ =
853 keyboard_brightness_control_delegate.Pass(); 862 keyboard_brightness_control_delegate.Pass();
854 } 863 }
855 864
856 bool AcceleratorController::CanHandleAccelerators() const { 865 bool AcceleratorController::CanHandleAccelerators() const {
857 return true; 866 return true;
858 } 867 }
859 868
860 } // namespace ash 869 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698