Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 478 return false; | 478 return false; |
| 479 if (key_code == ui::VKEY_LWIN) | 479 if (key_code == ui::VKEY_LWIN) |
| 480 base::RecordAction(base::UserMetricsAction("Accel_Search_LWin")); | 480 base::RecordAction(base::UserMetricsAction("Accel_Search_LWin")); |
| 481 // When spoken feedback is enabled, we should neither toggle the list nor | 481 // When spoken feedback is enabled, we should neither toggle the list nor |
| 482 // consume the key since Search+Shift is one of the shortcuts the a11y | 482 // consume the key since Search+Shift is one of the shortcuts the a11y |
| 483 // feature uses. crbug.com/132296 | 483 // feature uses. crbug.com/132296 |
| 484 DCHECK_EQ(ui::VKEY_LWIN, accelerator.key_code()); | 484 DCHECK_EQ(ui::VKEY_LWIN, accelerator.key_code()); |
| 485 if (Shell::GetInstance()->accessibility_delegate()-> | 485 if (Shell::GetInstance()->accessibility_delegate()-> |
| 486 IsSpokenFeedbackEnabled()) | 486 IsSpokenFeedbackEnabled()) |
| 487 return false; | 487 return false; |
| 488 ash::Shell::GetInstance()->ToggleAppList(NULL); | 488 if (ash::Shell::GetInstance()->GetAppListTargetVisibility()) |
|
Matt Giuca
2014/08/14 04:17:06
I think it would be good to preserve ToggleAppList
calamity
2014/08/14 05:00:59
Done.
| |
| 489 ash::Shell::GetInstance()->DismissAppList(); | |
| 490 else | |
| 491 ash::Shell::GetInstance()->ShowAppList(NULL); | |
| 489 return true; | 492 return true; |
| 490 } | 493 } |
| 491 | 494 |
| 492 bool HandleToggleFullscreen(ui::KeyboardCode key_code) { | 495 bool HandleToggleFullscreen(ui::KeyboardCode key_code) { |
| 493 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP2) { | 496 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP2) { |
| 494 base::RecordAction(UserMetricsAction("Accel_Fullscreen_F4")); | 497 base::RecordAction(UserMetricsAction("Accel_Fullscreen_F4")); |
| 495 } | 498 } |
| 496 accelerators::ToggleFullscreen(); | 499 accelerators::ToggleFullscreen(); |
| 497 return true; | 500 return true; |
| 498 } | 501 } |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1202 keyboard_brightness_control_delegate) { | 1205 keyboard_brightness_control_delegate) { |
| 1203 keyboard_brightness_control_delegate_ = | 1206 keyboard_brightness_control_delegate_ = |
| 1204 keyboard_brightness_control_delegate.Pass(); | 1207 keyboard_brightness_control_delegate.Pass(); |
| 1205 } | 1208 } |
| 1206 | 1209 |
| 1207 bool AcceleratorController::CanHandleAccelerators() const { | 1210 bool AcceleratorController::CanHandleAccelerators() const { |
| 1208 return true; | 1211 return true; |
| 1209 } | 1212 } |
| 1210 | 1213 |
| 1211 } // namespace ash | 1214 } // namespace ash |
| OLD | NEW |