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

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

Issue 2825383003: Fix stylus tools palette. (Closed)
Patch Set: Fix nits. Created 3 years, 7 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 | ash/ash_switches.h » ('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/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/accelerators/accelerator_commands.h" 9 #include "ash/accelerators/accelerator_commands.h"
10 #include "ash/accelerators/accelerator_controller_delegate.h" 10 #include "ash/accelerators/accelerator_controller_delegate.h"
11 #include "ash/accelerators/debug_commands.h" 11 #include "ash/accelerators/debug_commands.h"
12 #include "ash/accessibility_delegate.h" 12 #include "ash/accessibility_delegate.h"
13 #include "ash/accessibility_types.h" 13 #include "ash/accessibility_types.h"
14 #include "ash/focus_cycler.h" 14 #include "ash/focus_cycler.h"
15 #include "ash/ime_control_delegate.h" 15 #include "ash/ime_control_delegate.h"
16 #include "ash/media_controller.h" 16 #include "ash/media_controller.h"
17 #include "ash/multi_profile_uma.h" 17 #include "ash/multi_profile_uma.h"
18 #include "ash/new_window_controller.h" 18 #include "ash/new_window_controller.h"
19 #include "ash/palette_delegate.h"
20 #include "ash/resources/vector_icons/vector_icons.h" 19 #include "ash/resources/vector_icons/vector_icons.h"
21 #include "ash/root_window_controller.h" 20 #include "ash/root_window_controller.h"
22 #include "ash/rotator/window_rotation.h" 21 #include "ash/rotator/window_rotation.h"
23 #include "ash/session/session_controller.h" 22 #include "ash/session/session_controller.h"
24 #include "ash/shelf/shelf_widget.h" 23 #include "ash/shelf/shelf_widget.h"
25 #include "ash/shelf/wm_shelf.h" 24 #include "ash/shelf/wm_shelf.h"
26 #include "ash/shell.h" 25 #include "ash/shell.h"
27 #include "ash/shell_delegate.h" 26 #include "ash/shell_delegate.h"
28 #include "ash/shell_port.h" 27 #include "ash/shell_port.h"
29 #include "ash/strings/grit/ash_strings.h" 28 #include "ash/strings/grit/ash_strings.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools")); 509 base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools"));
511 Shell::GetWmRootWindowForNewWindows() 510 Shell::GetWmRootWindowForNewWindows()
512 ->GetRootWindowController() 511 ->GetRootWindowController()
513 ->GetShelf() 512 ->GetShelf()
514 ->GetStatusAreaWidget() 513 ->GetStatusAreaWidget()
515 ->palette_tray() 514 ->palette_tray()
516 ->ShowPalette(); 515 ->ShowPalette();
517 } 516 }
518 517
519 bool CanHandleShowStylusTools() { 518 bool CanHandleShowStylusTools() {
520 StatusAreaWidget* status_area_widget = Shell::GetWmRootWindowForNewWindows() 519 return palette_utils::ShouldShowPalette();
521 ->GetRootWindowController()
522 ->GetShelf()
523 ->GetStatusAreaWidget();
524 // Tests (clusterfuzz) can trigger this before the status area is ready.
525 return status_area_widget && status_area_widget->palette_tray() &&
526 Shell::Get()->palette_delegate() &&
527 Shell::Get()->palette_delegate()->ShouldShowPalette();
528 } 520 }
529 521
530 void HandleSuspend() { 522 void HandleSuspend() {
531 base::RecordAction(UserMetricsAction("Accel_Suspend")); 523 base::RecordAction(UserMetricsAction("Accel_Suspend"));
532 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestSuspend(); 524 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestSuspend();
533 } 525 }
534 526
535 bool CanHandleCycleUser() { 527 bool CanHandleCycleUser() {
536 return Shell::Get()->shell_delegate()->IsMultiProfilesEnabled() && 528 return Shell::Get()->shell_delegate()->IsMultiProfilesEnabled() &&
537 Shell::Get()->session_controller()->NumberOfLoggedInUsers() > 1; 529 Shell::Get()->session_controller()->NumberOfLoggedInUsers() > 1;
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 data->uma_histogram_name, data->notification_message_id, 1299 data->uma_histogram_name, data->notification_message_id,
1308 data->old_shortcut_id, data->new_shortcut_id); 1300 data->old_shortcut_id, data->new_shortcut_id);
1309 1301
1310 if (!data->deprecated_enabled) 1302 if (!data->deprecated_enabled)
1311 return AcceleratorProcessingStatus::STOP; 1303 return AcceleratorProcessingStatus::STOP;
1312 1304
1313 return AcceleratorProcessingStatus::PROCEED; 1305 return AcceleratorProcessingStatus::PROCEED;
1314 } 1306 }
1315 1307
1316 } // namespace ash 1308 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/ash_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698