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

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

Issue 2604093003: Don't mark virtual keyboard events as synthesized or distinguish between (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.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/common/accelerators/accelerator_controller.h" 5 #include "ash/common/accelerators/accelerator_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/accelerators/accelerator_commands.h" 9 #include "ash/common/accelerators/accelerator_commands.h"
10 #include "ash/common/accelerators/accelerator_controller_delegate.h" 10 #include "ash/common/accelerators/accelerator_controller_delegate.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 bool CanHandleNextIme(ImeControlDelegate* ime_control_delegate) { 167 bool CanHandleNextIme(ImeControlDelegate* ime_control_delegate) {
168 return ime_control_delegate && ime_control_delegate->CanCycleIme(); 168 return ime_control_delegate && ime_control_delegate->CanCycleIme();
169 } 169 }
170 170
171 bool CanHandleCycleMru(const ui::Accelerator& accelerator) { 171 bool CanHandleCycleMru(const ui::Accelerator& accelerator) {
172 // Don't do anything when Alt+Tab comes from a virtual keyboard. Touchscreen 172 // Don't do anything when Alt+Tab comes from a virtual keyboard. Touchscreen
173 // users have better window switching options. See http://crbug.com/638269 173 // users have better window switching options. See http://crbug.com/638269
174 keyboard::KeyboardController* keyboard_controller = 174 keyboard::KeyboardController* keyboard_controller =
175 keyboard::KeyboardController::GetInstance(); 175 keyboard::KeyboardController::GetInstance();
176 return !(keyboard_controller && keyboard_controller->keyboard_visible() && 176 return !(keyboard_controller && keyboard_controller->keyboard_visible());
oshima 2017/01/05 22:11:35 Hmm that's unfortunate. Could you please add comm
Evan Stade 2017/01/06 19:37:51 Done.
177 (accelerator.modifiers() & ui::EF_IS_SYNTHESIZED));
178 } 177 }
179 178
180 // We must avoid showing the Deprecated NEXT_IME notification erronously. 179 // We must avoid showing the Deprecated NEXT_IME notification erronously.
181 bool ShouldShowDeprecatedNextImeNotification( 180 bool ShouldShowDeprecatedNextImeNotification(
182 const ui::Accelerator& previous_accelerator) { 181 const ui::Accelerator& previous_accelerator) {
183 // We only show the deprecation notification if the previous accelerator key 182 // We only show the deprecation notification if the previous accelerator key
184 // is ONLY either Shift, or Alt. 183 // is ONLY either Shift, or Alt.
185 const ui::KeyboardCode previous_key_code = previous_accelerator.key_code(); 184 const ui::KeyboardCode previous_key_code = previous_accelerator.key_code();
186 switch (previous_key_code) { 185 switch (previous_key_code) {
187 case ui::VKEY_SHIFT: 186 case ui::VKEY_SHIFT:
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && 1167 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() &&
1169 actions_needing_window_.find(action) != actions_needing_window_.end()) { 1168 actions_needing_window_.find(action) != actions_needing_window_.end()) {
1170 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( 1169 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert(
1171 A11Y_ALERT_WINDOW_NEEDED); 1170 A11Y_ALERT_WINDOW_NEEDED);
1172 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; 1171 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION;
1173 } 1172 }
1174 return RESTRICTION_NONE; 1173 return RESTRICTION_NONE;
1175 } 1174 }
1176 1175
1177 } // namespace ash 1176 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698