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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 2858583002: Fix crash when pressing stylus tools accelerator with null PaletteTray. (Closed)
Patch Set: . Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 4e06455c59a0d117434af3e32157e1a62d03a814..671742e49ff0c611ac57e1143d3e407ee55cf25b 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -508,18 +508,22 @@ void HandleLock() {
void HandleShowStylusTools() {
base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools"));
-
- RootWindowController* root_window_controller =
- Shell::GetWmRootWindowForNewWindows()->GetRootWindowController();
- StatusAreaWidget* status_area_widget =
- root_window_controller->GetShelf()->GetStatusAreaWidget();
- // Tests (clusterfuzz) can trigger this before the status area is ready.
- if (status_area_widget)
- status_area_widget->palette_tray()->ShowPalette();
+ Shell::GetWmRootWindowForNewWindows()
+ ->GetRootWindowController()
+ ->GetShelf()
+ ->GetStatusAreaWidget()
+ ->palette_tray()
+ ->ShowPalette();
}
bool CanHandleShowStylusTools() {
- return Shell::Get()->palette_delegate() &&
+ StatusAreaWidget* status_area_widget = Shell::GetWmRootWindowForNewWindows()
+ ->GetRootWindowController()
+ ->GetShelf()
+ ->GetStatusAreaWidget();
+ // Tests (clusterfuzz) can trigger this before the status area is ready.
+ return status_area_widget && status_area_widget->palette_tray() &&
+ Shell::Get()->palette_delegate() &&
Shell::Get()->palette_delegate()->ShouldShowPalette();
}
« 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