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

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

Issue 2093573003: Debug shortcut to toggle touch view (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments. revert unnecesary change Created 4 years, 6 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 | « ash/accelerators/accelerator_table.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/accelerators/debug_commands.h" 5 #include "ash/accelerators/debug_commands.h"
6 6
7 #include "ash/accelerators/accelerator_commands.h" 7 #include "ash/accelerators/accelerator_commands.h"
8 #include "ash/common/ash_switches.h" 8 #include "ash/common/ash_switches.h"
9 #include "ash/debug.h" 9 #include "ash/debug.h"
10 #include "ash/desktop_background/desktop_background_controller.h" 10 #include "ash/desktop_background/desktop_background_controller.h"
11 #include "ash/desktop_background/user_wallpaper_delegate.h" 11 #include "ash/desktop_background/user_wallpaper_delegate.h"
12 #include "ash/display/display_manager.h" 12 #include "ash/display/display_manager.h"
13 #include "ash/host/ash_window_tree_host.h" 13 #include "ash/host/ash_window_tree_host.h"
14 #include "ash/root_window_controller.h" 14 #include "ash/root_window_controller.h"
15 #include "ash/shell.h" 15 #include "ash/shell.h"
16 #include "ash/shell_delegate.h" 16 #include "ash/shell_delegate.h"
17 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
17 #include "ash/wm/window_util.h" 18 #include "ash/wm/window_util.h"
18 #include "base/command_line.h" 19 #include "base/command_line.h"
19 #include "base/metrics/user_metrics.h" 20 #include "base/metrics/user_metrics.h"
20 #include "base/metrics/user_metrics_action.h" 21 #include "base/metrics/user_metrics_action.h"
21 #include "third_party/skia/include/core/SkColor.h" 22 #include "third_party/skia/include/core/SkColor.h"
22 #include "third_party/skia/include/core/SkPaint.h" 23 #include "third_party/skia/include/core/SkPaint.h"
23 #include "ui/aura/window.h" 24 #include "ui/aura/window.h"
24 #include "ui/aura/window_event_dispatcher.h" 25 #include "ui/aura/window_event_dispatcher.h"
25 #include "ui/compositor/debug_utils.h" 26 #include "ui/compositor/debug_utils.h"
26 #include "ui/compositor/layer.h" 27 #include "ui/compositor/layer.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 134
134 ash::Shell::GetInstance()->delegate()->ToggleTouchpad(); 135 ash::Shell::GetInstance()->delegate()->ToggleTouchpad();
135 } 136 }
136 137
137 void HandleToggleTouchscreen() { 138 void HandleToggleTouchscreen() {
138 base::RecordAction(base::UserMetricsAction("Accel_Toggle_Touchscreen")); 139 base::RecordAction(base::UserMetricsAction("Accel_Toggle_Touchscreen"));
139 140
140 ash::Shell::GetInstance()->delegate()->ToggleTouchscreen(); 141 ash::Shell::GetInstance()->delegate()->ToggleTouchscreen();
141 } 142 }
142 143
144 void HandleToggleToggleTouchView() {
145 MaximizeModeController* controller =
146 Shell::GetInstance()->maximize_mode_controller();
147 controller->EnableMaximizeModeWindowManager(
148 !controller->IsMaximizeModeWindowManagerEnabled());
149 }
150
143 #endif // defined(OS_CHROMEOS) 151 #endif // defined(OS_CHROMEOS)
144 152
145 } // namespace 153 } // namespace
146 154
147 void PrintUIHierarchies() { 155 void PrintUIHierarchies() {
148 // This is a separate command so the user only has to hit one key to generate 156 // This is a separate command so the user only has to hit one key to generate
149 // all the logs. Developers use the individual dumps repeatedly, so keep 157 // all the logs. Developers use the individual dumps repeatedly, so keep
150 // those as separate commands to avoid spamming their logs. 158 // those as separate commands to avoid spamming their logs.
151 HandlePrintLayerHierarchy(); 159 HandlePrintLayerHierarchy();
152 HandlePrintWindowHierarchy(); 160 HandlePrintWindowHierarchy();
(...skipping 13 matching lines...) Expand all
166 #if defined(OS_CHROMEOS) 174 #if defined(OS_CHROMEOS)
167 case DEBUG_ADD_REMOVE_DISPLAY: 175 case DEBUG_ADD_REMOVE_DISPLAY:
168 Shell::GetInstance()->display_manager()->AddRemoveDisplay(); 176 Shell::GetInstance()->display_manager()->AddRemoveDisplay();
169 break; 177 break;
170 case DEBUG_TOGGLE_TOUCH_PAD: 178 case DEBUG_TOGGLE_TOUCH_PAD:
171 HandleToggleTouchpad(); 179 HandleToggleTouchpad();
172 break; 180 break;
173 case DEBUG_TOGGLE_TOUCH_SCREEN: 181 case DEBUG_TOGGLE_TOUCH_SCREEN:
174 HandleToggleTouchscreen(); 182 HandleToggleTouchscreen();
175 break; 183 break;
184 case DEBUG_TOGGLE_TOUCH_VIEW:
185 HandleToggleToggleTouchView();
186 break;
176 case DEBUG_TOGGLE_UNIFIED_DESKTOP: 187 case DEBUG_TOGGLE_UNIFIED_DESKTOP:
177 Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled( 188 Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(
178 !Shell::GetInstance()->display_manager()->unified_desktop_enabled()); 189 !Shell::GetInstance()->display_manager()->unified_desktop_enabled());
179 break; 190 break;
180 #endif 191 #endif
181 case DEBUG_PRINT_LAYER_HIERARCHY: 192 case DEBUG_PRINT_LAYER_HIERARCHY:
182 HandlePrintLayerHierarchy(); 193 HandlePrintLayerHierarchy();
183 break; 194 break;
184 case DEBUG_PRINT_VIEW_HIERARCHY: 195 case DEBUG_PRINT_VIEW_HIERARCHY:
185 HandlePrintViewHierarchy(); 196 HandlePrintViewHierarchy();
(...skipping 19 matching lines...) Expand all
205 case DEBUG_TOGGLE_SHOW_PAINT_RECTS: 216 case DEBUG_TOGGLE_SHOW_PAINT_RECTS:
206 ToggleShowPaintRects(); 217 ToggleShowPaintRects();
207 break; 218 break;
208 default: 219 default:
209 break; 220 break;
210 } 221 }
211 } 222 }
212 223
213 } // namespace debug 224 } // namespace debug
214 } // namespace ash 225 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_table.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698