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

Side by Side Diff: chrome/browser/ui/views/aura/caps_lock_handler.cc

Issue 9129016: Ignore Shift+Search when spoken feedback is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 8 years, 11 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 | no next file » | 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 "chrome/browser/ui/views/aura/caps_lock_handler.h" 5 #include "chrome/browser/ui/views/aura/caps_lock_handler.h"
6 6
7 #include "content/public/browser/browser_thread.h" 7 #include "content/public/browser/browser_thread.h"
8 8
9 // TODO(yusukes): Support Ash on Windows. 9 // TODO(yusukes): Support Ash on Windows.
10 #if defined(OS_CHROMEOS) 10 #if defined(OS_CHROMEOS)
11 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/chromeos/input_method/xkeyboard.h" 12 #include "chrome/browser/chromeos/input_method/xkeyboard.h"
12 #include "chrome/browser/chromeos/system/runtime_environment.h" 13 #include "chrome/browser/chromeos/system/runtime_environment.h"
14 #include "chrome/browser/prefs/pref_service.h"
15 #include "chrome/common/pref_names.h"
13 #endif 16 #endif
14 17
15 #if defined(OS_CHROMEOS) 18 #if defined(OS_CHROMEOS)
16 CapsLockHandler::CapsLockHandler(chromeos::input_method::XKeyboard* xkeyboard) 19 CapsLockHandler::CapsLockHandler(chromeos::input_method::XKeyboard* xkeyboard)
17 : xkeyboard_(xkeyboard), 20 : xkeyboard_(xkeyboard),
18 is_running_on_chromeos_( 21 is_running_on_chromeos_(
19 chromeos::system::runtime_environment::IsRunningOnChromeOS()), 22 chromeos::system::runtime_environment::IsRunningOnChromeOS()),
20 caps_lock_is_on_(xkeyboard_->CapsLockIsEnabled()) { 23 caps_lock_is_on_(xkeyboard_->CapsLockIsEnabled()) {
21 chromeos::SystemKeyEventListener* system_event_listener = 24 chromeos::SystemKeyEventListener* system_event_listener =
22 chromeos::SystemKeyEventListener::GetInstance(); 25 chromeos::SystemKeyEventListener::GetInstance();
(...skipping 10 matching lines...) Expand all
33 chromeos::SystemKeyEventListener* system_event_listener = 36 chromeos::SystemKeyEventListener* system_event_listener =
34 chromeos::SystemKeyEventListener::GetInstance(); 37 chromeos::SystemKeyEventListener::GetInstance();
35 if (system_event_listener) 38 if (system_event_listener)
36 system_event_listener->RemoveCapsLockObserver(this); 39 system_event_listener->RemoveCapsLockObserver(this);
37 #endif 40 #endif
38 } 41 }
39 42
40 bool CapsLockHandler::HandleToggleCapsLock() { 43 bool CapsLockHandler::HandleToggleCapsLock() {
41 #if defined(OS_CHROMEOS) 44 #if defined(OS_CHROMEOS)
42 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 45 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
43 if (is_running_on_chromeos_) { 46 if (is_running_on_chromeos_ &&
44 // TODO(yusukes): Do not change Caps Lock status and just return false if 47 // When spoken feedback is enabled, the Search key is used as an
45 // spoken feedback is enabled (crosbug.com/110127). 48 // accessibility modifier key.
49 !g_browser_process->local_state()->GetBoolean(
50 prefs::kSpokenFeedbackEnabled)) {
46 xkeyboard_->SetCapsLockEnabled(!caps_lock_is_on_); 51 xkeyboard_->SetCapsLockEnabled(!caps_lock_is_on_);
47 return true; // consume the shortcut key. 52 return true; // consume the shortcut key.
48 } 53 }
49 #else 54 #else
50 NOTIMPLEMENTED(); 55 NOTIMPLEMENTED();
51 #endif 56 #endif
52 return false; 57 return false;
53 } 58 }
54 59
55 #if defined(OS_CHROMEOS) 60 #if defined(OS_CHROMEOS)
56 void CapsLockHandler::OnCapsLockChange(bool enabled) { 61 void CapsLockHandler::OnCapsLockChange(bool enabled) {
57 caps_lock_is_on_ = enabled; 62 caps_lock_is_on_ = enabled;
58 } 63 }
59 #endif 64 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698