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

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

Issue 2615743002: cros: Fix clusterfuzz crash when spawning app list very early in startup (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 | « ash/app_list/app_list_presenter_delegate.cc ('k') | 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 "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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 262 }
263 263
264 void HandleSwitchIme(ImeControlDelegate* ime_control_delegate, 264 void HandleSwitchIme(ImeControlDelegate* ime_control_delegate,
265 const ui::Accelerator& accelerator) { 265 const ui::Accelerator& accelerator) {
266 base::RecordAction(UserMetricsAction("Accel_Switch_Ime")); 266 base::RecordAction(UserMetricsAction("Accel_Switch_Ime"));
267 ime_control_delegate->HandleSwitchIme(accelerator); 267 ime_control_delegate->HandleSwitchIme(accelerator);
268 } 268 }
269 269
270 bool CanHandleToggleAppList(const ui::Accelerator& accelerator, 270 bool CanHandleToggleAppList(const ui::Accelerator& accelerator,
271 const ui::Accelerator& previous_accelerator) { 271 const ui::Accelerator& previous_accelerator) {
272 // Some tests try to spawn the app list before the shelf is created, but the
273 // app list depends on the shelf for positioning. Users never open the app
msw 2017/01/05 00:41:34 The app list doesn't actually depend on the shelf
274 // list that early, so disable showing it. http://crbug.com/676843
275 WmWindow* target_root = WmShell::Get()->GetRootWindowForNewWindows();
276 if (!WmShelf::ForWindow(target_root)->IsShelfInitialized())
277 return false;
278
272 if (accelerator.key_code() == ui::VKEY_LWIN) { 279 if (accelerator.key_code() == ui::VKEY_LWIN) {
273 // If something else was pressed between the Search key (LWIN) 280 // If something else was pressed between the Search key (LWIN)
274 // being pressed and released, then ignore the release of the 281 // being pressed and released, then ignore the release of the
275 // Search key. 282 // Search key.
276 if (previous_accelerator.type() != ui::ET_KEY_PRESSED || 283 if (previous_accelerator.type() != ui::ET_KEY_PRESSED ||
277 previous_accelerator.key_code() != ui::VKEY_LWIN) { 284 previous_accelerator.key_code() != ui::VKEY_LWIN) {
278 return false; 285 return false;
279 } 286 }
280 287
281 // When spoken feedback is enabled, we should neither toggle the list nor 288 // When spoken feedback is enabled, we should neither toggle the list nor
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && 1175 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() &&
1169 actions_needing_window_.find(action) != actions_needing_window_.end()) { 1176 actions_needing_window_.find(action) != actions_needing_window_.end()) {
1170 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( 1177 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert(
1171 A11Y_ALERT_WINDOW_NEEDED); 1178 A11Y_ALERT_WINDOW_NEEDED);
1172 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; 1179 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION;
1173 } 1180 }
1174 return RESTRICTION_NONE; 1181 return RESTRICTION_NONE;
1175 } 1182 }
1176 1183
1177 } // namespace ash 1184 } // namespace ash
OLDNEW
« no previous file with comments | « ash/app_list/app_list_presenter_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698