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

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

Issue 2825383003: Fix stylus tools palette. (Closed)
Patch Set: Load palette_tray all the time. Only check when show it 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/ash_switches.h » ('j') | ash/system/palette/palette_utils.h » ('J')
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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 RootWindowController* root_window_controller = 511 RootWindowController* root_window_controller =
513 Shell::GetWmRootWindowForNewWindows()->GetRootWindowController(); 512 Shell::GetWmRootWindowForNewWindows()->GetRootWindowController();
514 StatusAreaWidget* status_area_widget = 513 StatusAreaWidget* status_area_widget =
515 root_window_controller->GetShelf()->GetStatusAreaWidget(); 514 root_window_controller->GetShelf()->GetStatusAreaWidget();
516 // Tests (clusterfuzz) can trigger this before the status area is ready. 515 // Tests (clusterfuzz) can trigger this before the status area is ready.
517 if (status_area_widget) 516 if (status_area_widget)
518 status_area_widget->palette_tray()->ShowPalette(); 517 status_area_widget->palette_tray()->ShowPalette();
519 } 518 }
520 519
521 bool CanHandleShowStylusTools() { 520 bool CanHandleShowStylusTools() {
522 return Shell::Get()->palette_delegate() && 521 return palette_utils::ShouldShowPalette();
523 Shell::Get()->palette_delegate()->ShouldShowPalette();
524 } 522 }
525 523
526 void HandleSuspend() { 524 void HandleSuspend() {
527 base::RecordAction(UserMetricsAction("Accel_Suspend")); 525 base::RecordAction(UserMetricsAction("Accel_Suspend"));
528 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestSuspend(); 526 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestSuspend();
529 } 527 }
530 528
531 bool CanHandleCycleUser() { 529 bool CanHandleCycleUser() {
532 return Shell::Get()->shell_delegate()->IsMultiProfilesEnabled() && 530 return Shell::Get()->shell_delegate()->IsMultiProfilesEnabled() &&
533 Shell::Get()->session_controller()->NumberOfLoggedInUsers() > 1; 531 Shell::Get()->session_controller()->NumberOfLoggedInUsers() > 1;
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 data->uma_histogram_name, data->notification_message_id, 1301 data->uma_histogram_name, data->notification_message_id,
1304 data->old_shortcut_id, data->new_shortcut_id); 1302 data->old_shortcut_id, data->new_shortcut_id);
1305 1303
1306 if (!data->deprecated_enabled) 1304 if (!data->deprecated_enabled)
1307 return AcceleratorProcessingStatus::STOP; 1305 return AcceleratorProcessingStatus::STOP;
1308 1306
1309 return AcceleratorProcessingStatus::PROCEED; 1307 return AcceleratorProcessingStatus::PROCEED;
1310 } 1308 }
1311 1309
1312 } // namespace ash 1310 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/ash_switches.h » ('j') | ash/system/palette/palette_utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698