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

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

Issue 2738133003: Promotes a handful of members from WmShell to Shell (Closed)
Patch Set: merge Created 3 years, 9 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
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/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"
11 #include "ash/common/system/toast/toast_manager.h" 11 #include "ash/common/system/toast/toast_manager.h"
12 #include "ash/common/wallpaper/wallpaper_controller.h" 12 #include "ash/common/wallpaper/wallpaper_controller.h"
13 #include "ash/common/wallpaper/wallpaper_delegate.h" 13 #include "ash/common/wallpaper/wallpaper_delegate.h"
14 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 14 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
15 #include "ash/common/wm_shell.h" 15 #include "ash/common/wm_shell.h"
16 #include "ash/common/wm_window.h" 16 #include "ash/common/wm_window.h"
17 #include "ash/root_window_controller.h" 17 #include "ash/root_window_controller.h"
18 #include "ash/shell.h"
18 #include "ash/wm/window_properties.h" 19 #include "ash/wm/window_properties.h"
19 #include "base/command_line.h" 20 #include "base/command_line.h"
20 #include "base/metrics/user_metrics.h" 21 #include "base/metrics/user_metrics.h"
21 #include "base/metrics/user_metrics_action.h" 22 #include "base/metrics/user_metrics_action.h"
22 #include "base/strings/utf_string_conversions.h" 23 #include "base/strings/utf_string_conversions.h"
23 #include "ui/compositor/debug_utils.h" 24 #include "ui/compositor/debug_utils.h"
24 #include "ui/compositor/layer.h" 25 #include "ui/compositor/layer.h"
25 #include "ui/gfx/canvas.h" 26 #include "ui/gfx/canvas.h"
26 #include "ui/gfx/image/image_skia.h" 27 #include "ui/gfx/image/image_skia.h"
27 #include "ui/views/debug_utils.h" 28 #include "ui/views/debug_utils.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 flags.setStrokeWidth(10); 97 flags.setStrokeWidth(10);
97 flags.setStyle(cc::PaintFlags::kStroke_Style); 98 flags.setStyle(cc::PaintFlags::kStroke_Style);
98 flags.setBlendMode(SkBlendMode::kSrcOver); 99 flags.setBlendMode(SkBlendMode::kSrcOver);
99 canvas.DrawRoundRect(gfx::Rect(image_size), 100, flags); 100 canvas.DrawRoundRect(gfx::Rect(image_size), 100, flags);
100 return gfx::ImageSkia(canvas.ExtractImageRep()); 101 return gfx::ImageSkia(canvas.ExtractImageRep());
101 } 102 }
102 103
103 void HandleToggleWallpaperMode() { 104 void HandleToggleWallpaperMode() {
104 static int index = 0; 105 static int index = 0;
105 WallpaperController* wallpaper_controller = 106 WallpaperController* wallpaper_controller =
106 WmShell::Get()->wallpaper_controller(); 107 Shell::GetInstance()->wallpaper_controller();
107 switch (++index % 4) { 108 switch (++index % 4) {
108 case 0: 109 case 0:
109 ash::WmShell::Get()->wallpaper_delegate()->InitializeWallpaper(); 110 ash::WmShell::Get()->wallpaper_delegate()->InitializeWallpaper();
110 break; 111 break;
111 case 1: 112 case 1:
112 wallpaper_controller->SetWallpaperImage( 113 wallpaper_controller->SetWallpaperImage(
113 CreateWallpaperImage(SK_ColorRED, SK_ColorBLUE), 114 CreateWallpaperImage(SK_ColorRED, SK_ColorBLUE),
114 wallpaper::WALLPAPER_LAYOUT_STRETCH); 115 wallpaper::WALLPAPER_LAYOUT_STRETCH);
115 break; 116 break;
116 case 2: 117 case 2:
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 case DEBUG_PRINT_LAYER_HIERARCHY: 181 case DEBUG_PRINT_LAYER_HIERARCHY:
181 HandlePrintLayerHierarchy(); 182 HandlePrintLayerHierarchy();
182 break; 183 break;
183 case DEBUG_PRINT_VIEW_HIERARCHY: 184 case DEBUG_PRINT_VIEW_HIERARCHY:
184 HandlePrintViewHierarchy(); 185 HandlePrintViewHierarchy();
185 break; 186 break;
186 case DEBUG_PRINT_WINDOW_HIERARCHY: 187 case DEBUG_PRINT_WINDOW_HIERARCHY:
187 HandlePrintWindowHierarchy(); 188 HandlePrintWindowHierarchy();
188 break; 189 break;
189 case DEBUG_SHOW_TOAST: 190 case DEBUG_SHOW_TOAST:
190 WmShell::Get()->toast_manager()->Show( 191 Shell::GetInstance()->toast_manager()->Show(
191 ToastData("id", base::ASCIIToUTF16("Toast"), 5000 /* duration_ms */, 192 ToastData("id", base::ASCIIToUTF16("Toast"), 5000 /* duration_ms */,
192 base::ASCIIToUTF16("Dismiss"))); 193 base::ASCIIToUTF16("Dismiss")));
193 break; 194 break;
194 case DEBUG_TOGGLE_TOUCH_PAD: 195 case DEBUG_TOGGLE_TOUCH_PAD:
195 HandleToggleTouchpad(); 196 HandleToggleTouchpad();
196 break; 197 break;
197 case DEBUG_TOGGLE_TOUCH_SCREEN: 198 case DEBUG_TOGGLE_TOUCH_SCREEN:
198 HandleToggleTouchscreen(); 199 HandleToggleTouchscreen();
199 break; 200 break;
200 case DEBUG_TOGGLE_TOUCH_VIEW: 201 case DEBUG_TOGGLE_TOUCH_VIEW:
201 HandleToggleTouchView(); 202 HandleToggleTouchView();
202 break; 203 break;
203 case DEBUG_TOGGLE_WALLPAPER_MODE: 204 case DEBUG_TOGGLE_WALLPAPER_MODE:
204 HandleToggleWallpaperMode(); 205 HandleToggleWallpaperMode();
205 break; 206 break;
206 case DEBUG_TRIGGER_CRASH: 207 case DEBUG_TRIGGER_CRASH:
207 HandleTriggerCrash(); 208 HandleTriggerCrash();
208 break; 209 break;
209 default: 210 default:
210 break; 211 break;
211 } 212 }
212 } 213 }
213 214
214 } // namespace debug 215 } // namespace debug
215 } // namespace ash 216 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/accelerators/accelerator_controller.cc ('k') | ash/common/devtools/ash_devtools_dom_agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698