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

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

Issue 11113004: Do not consume keys for DISABLE_CAPS_LOCK when caps lock is off. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add test Created 8 years, 2 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 | 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 if (Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled()) 549 if (Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled())
550 return false; 550 return false;
551 ash::Shell::GetInstance()->ToggleAppList(); 551 ash::Shell::GetInstance()->ToggleAppList();
552 return true; 552 return true;
553 case DISABLE_CAPS_LOCK: 553 case DISABLE_CAPS_LOCK:
554 // See: case NEXT_IME. 554 // See: case NEXT_IME.
555 if (last_event_type == ui::ET_KEY_RELEASED) { 555 if (last_event_type == ui::ET_KEY_RELEASED) {
556 // We totally ignore this accelerator. 556 // We totally ignore this accelerator.
557 return false; 557 return false;
558 } 558 }
559 if (shell->caps_lock_delegate()->IsCapsLockEnabled()) 559 if (shell->caps_lock_delegate()->IsCapsLockEnabled()) {
560 shell->caps_lock_delegate()->SetCapsLockEnabled(false); 560 shell->caps_lock_delegate()->SetCapsLockEnabled(false);
561 return true; 561 return true;
562 }
563 return false;
562 case TOGGLE_CAPS_LOCK: 564 case TOGGLE_CAPS_LOCK:
563 shell->caps_lock_delegate()->ToggleCapsLock(); 565 shell->caps_lock_delegate()->ToggleCapsLock();
564 return true; 566 return true;
565 case BRIGHTNESS_DOWN: 567 case BRIGHTNESS_DOWN:
566 if (brightness_control_delegate_.get()) 568 if (brightness_control_delegate_.get())
567 return brightness_control_delegate_->HandleBrightnessDown(accelerator); 569 return brightness_control_delegate_->HandleBrightnessDown(accelerator);
568 break; 570 break;
569 case BRIGHTNESS_UP: 571 case BRIGHTNESS_UP:
570 if (brightness_control_delegate_.get()) 572 if (brightness_control_delegate_.get())
571 return brightness_control_delegate_->HandleBrightnessUp(accelerator); 573 return brightness_control_delegate_->HandleBrightnessUp(accelerator);
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 accelerators_.insert( 884 accelerators_.insert(
883 std::make_pair(accelerator, accelerators[i].action)); 885 std::make_pair(accelerator, accelerators[i].action));
884 } 886 }
885 } 887 }
886 888
887 bool AcceleratorController::CanHandleAccelerators() const { 889 bool AcceleratorController::CanHandleAccelerators() const {
888 return true; 890 return true;
889 } 891 }
890 892
891 } // namespace ash 893 } // 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