Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/debug_commands.h" | 5 #include "ash/common/accelerators/debug_commands.h" |
| 6 | 6 |
| 7 #include "ash/common/accelerators/accelerator_commands.h" | 7 #include "ash/common/accelerators/accelerator_commands.h" |
| 8 #include "ash/common/ash_switches.h" | 8 #include "ash/common/ash_switches.h" |
| 9 #include "ash/common/shell_delegate.h" | 9 #include "ash/common/shell_delegate.h" |
| 10 #include "ash/common/system/toast/toast_data.h" | 10 #include "ash/common/system/toast/toast_data.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 | 121 |
| 122 #if defined(OS_CHROMEOS) | 122 #if defined(OS_CHROMEOS) |
| 123 | 123 |
| 124 void HandleToggleTouchpad() { | 124 void HandleToggleTouchpad() { |
| 125 base::RecordAction(base::UserMetricsAction("Accel_Toggle_Touchpad")); | 125 base::RecordAction(base::UserMetricsAction("Accel_Toggle_Touchpad")); |
| 126 ash::WmShell::Get()->delegate()->ToggleTouchpad(); | 126 ash::WmShell::Get()->delegate()->ToggleTouchpad(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void HandleToggleTouchscreen() { | 129 void HandleToggleTouchscreen() { |
| 130 base::RecordAction(base::UserMetricsAction("Accel_Toggle_Touchscreen")); | 130 base::RecordAction(base::UserMetricsAction("Accel_Toggle_Touchscreen")); |
| 131 ash::WmShell::Get()->delegate()->ToggleTouchscreen(); | 131 ShellDelegate* delegate = WmShell::Get()->delegate(); |
| 132 const bool touch_screen_status = delegate->IsTouchscreenEnabled(); | |
| 133 delegate->SetTouchscreenEnabled(!touch_screen_status); | |
|
Daniel Erat
2016/11/30 22:58:07
nit: i'd just inline this, e.g.
delegate->SetTo
Qiang(Joe) Xu
2016/12/02 17:42:51
Done.
| |
| 132 } | 134 } |
| 133 | 135 |
| 134 void HandleToggleTouchView() { | 136 void HandleToggleTouchView() { |
| 135 MaximizeModeController* controller = | 137 MaximizeModeController* controller = |
| 136 WmShell::Get()->maximize_mode_controller(); | 138 WmShell::Get()->maximize_mode_controller(); |
| 137 controller->EnableMaximizeModeWindowManager( | 139 controller->EnableMaximizeModeWindowManager( |
| 138 !controller->IsMaximizeModeWindowManagerEnabled()); | 140 !controller->IsMaximizeModeWindowManagerEnabled()); |
| 139 } | 141 } |
| 140 | 142 |
| 141 #endif // defined(OS_CHROMEOS) | 143 #endif // defined(OS_CHROMEOS) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 case DEBUG_PRINT_WINDOW_HIERARCHY: | 196 case DEBUG_PRINT_WINDOW_HIERARCHY: |
| 195 HandlePrintWindowHierarchy(); | 197 HandlePrintWindowHierarchy(); |
| 196 break; | 198 break; |
| 197 default: | 199 default: |
| 198 break; | 200 break; |
| 199 } | 201 } |
| 200 } | 202 } |
| 201 | 203 |
| 202 } // namespace debug | 204 } // namespace debug |
| 203 } // namespace ash | 205 } // namespace ash |
| OLD | NEW |