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/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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 void HandleLock() { | 507 void HandleLock() { |
508 base::RecordAction(UserMetricsAction("Accel_LockScreen_L")); | 508 base::RecordAction(UserMetricsAction("Accel_LockScreen_L")); |
509 WmShell::Get()->GetSessionStateDelegate()->LockScreen(); | 509 WmShell::Get()->GetSessionStateDelegate()->LockScreen(); |
510 } | 510 } |
511 | 511 |
512 void HandleShowStylusTools() { | 512 void HandleShowStylusTools() { |
513 base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools")); | 513 base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools")); |
514 | 514 |
515 RootWindowController* root_window_controller = | 515 RootWindowController* root_window_controller = |
516 Shell::GetWmRootWindowForNewWindows()->GetRootWindowController(); | 516 Shell::GetWmRootWindowForNewWindows()->GetRootWindowController(); |
517 PaletteTray* palette_tray = | 517 StatusAreaWidget* status_area_widget = |
518 root_window_controller->GetShelf()->GetStatusAreaWidget()->palette_tray(); | 518 root_window_controller->GetShelf()->GetStatusAreaWidget(); |
519 palette_tray->ShowPalette(); | 519 // Tests (clusterfuzz) can trigger this before the status area is ready. |
| 520 if (status_area_widget) |
| 521 status_area_widget->palette_tray()->ShowPalette(); |
520 } | 522 } |
521 | 523 |
522 bool CanHandleShowStylusTools() { | 524 bool CanHandleShowStylusTools() { |
523 return Shell::GetInstance()->palette_delegate() && | 525 return Shell::GetInstance()->palette_delegate() && |
524 Shell::GetInstance()->palette_delegate()->ShouldShowPalette(); | 526 Shell::GetInstance()->palette_delegate()->ShouldShowPalette(); |
525 } | 527 } |
526 | 528 |
527 void HandleSuspend() { | 529 void HandleSuspend() { |
528 base::RecordAction(UserMetricsAction("Accel_Suspend")); | 530 base::RecordAction(UserMetricsAction("Accel_Suspend")); |
529 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestSuspend(); | 531 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestSuspend(); |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 data->uma_histogram_name, data->notification_message_id, | 1293 data->uma_histogram_name, data->notification_message_id, |
1292 data->old_shortcut_id, data->new_shortcut_id); | 1294 data->old_shortcut_id, data->new_shortcut_id); |
1293 | 1295 |
1294 if (!data->deprecated_enabled) | 1296 if (!data->deprecated_enabled) |
1295 return AcceleratorProcessingStatus::STOP; | 1297 return AcceleratorProcessingStatus::STOP; |
1296 | 1298 |
1297 return AcceleratorProcessingStatus::PROCEED; | 1299 return AcceleratorProcessingStatus::PROCEED; |
1298 } | 1300 } |
1299 | 1301 |
1300 } // namespace ash | 1302 } // namespace ash |
OLD | NEW |