| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 canvas.DrawRoundRect(gfx::Rect(image_size), 100, flags); | 100 canvas.DrawRoundRect(gfx::Rect(image_size), 100, flags); |
| 101 return gfx::ImageSkia(canvas.ExtractImageRep()); | 101 return gfx::ImageSkia(canvas.ExtractImageRep()); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void HandleToggleWallpaperMode() { | 104 void HandleToggleWallpaperMode() { |
| 105 static int index = 0; | 105 static int index = 0; |
| 106 WallpaperController* wallpaper_controller = | 106 WallpaperController* wallpaper_controller = |
| 107 Shell::GetInstance()->wallpaper_controller(); | 107 Shell::GetInstance()->wallpaper_controller(); |
| 108 switch (++index % 4) { | 108 switch (++index % 4) { |
| 109 case 0: | 109 case 0: |
| 110 ash::WmShell::Get()->wallpaper_delegate()->InitializeWallpaper(); | 110 Shell::Get()->wallpaper_delegate()->InitializeWallpaper(); |
| 111 break; | 111 break; |
| 112 case 1: | 112 case 1: |
| 113 wallpaper_controller->SetWallpaperImage( | 113 wallpaper_controller->SetWallpaperImage( |
| 114 CreateWallpaperImage(SK_ColorRED, SK_ColorBLUE), | 114 CreateWallpaperImage(SK_ColorRED, SK_ColorBLUE), |
| 115 wallpaper::WALLPAPER_LAYOUT_STRETCH); | 115 wallpaper::WALLPAPER_LAYOUT_STRETCH); |
| 116 break; | 116 break; |
| 117 case 2: | 117 case 2: |
| 118 wallpaper_controller->SetWallpaperImage( | 118 wallpaper_controller->SetWallpaperImage( |
| 119 CreateWallpaperImage(SK_ColorBLUE, SK_ColorGREEN), | 119 CreateWallpaperImage(SK_ColorBLUE, SK_ColorGREEN), |
| 120 wallpaper::WALLPAPER_LAYOUT_CENTER); | 120 wallpaper::WALLPAPER_LAYOUT_CENTER); |
| 121 break; | 121 break; |
| 122 case 3: | 122 case 3: |
| 123 wallpaper_controller->SetWallpaperImage( | 123 wallpaper_controller->SetWallpaperImage( |
| 124 CreateWallpaperImage(SK_ColorGREEN, SK_ColorRED), | 124 CreateWallpaperImage(SK_ColorGREEN, SK_ColorRED), |
| 125 wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED); | 125 wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED); |
| 126 break; | 126 break; |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 void HandleToggleTouchpad() { | 130 void HandleToggleTouchpad() { |
| 131 base::RecordAction(base::UserMetricsAction("Accel_Toggle_Touchpad")); | 131 base::RecordAction(base::UserMetricsAction("Accel_Toggle_Touchpad")); |
| 132 ash::WmShell::Get()->delegate()->ToggleTouchpad(); | 132 Shell::Get()->shell_delegate()->ToggleTouchpad(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void HandleToggleTouchscreen() { | 135 void HandleToggleTouchscreen() { |
| 136 base::RecordAction(base::UserMetricsAction("Accel_Toggle_Touchscreen")); | 136 base::RecordAction(base::UserMetricsAction("Accel_Toggle_Touchscreen")); |
| 137 ShellDelegate* delegate = WmShell::Get()->delegate(); | 137 ShellDelegate* delegate = Shell::Get()->shell_delegate(); |
| 138 delegate->SetTouchscreenEnabledInPrefs( | 138 delegate->SetTouchscreenEnabledInPrefs( |
| 139 !delegate->IsTouchscreenEnabledInPrefs(false /* use_local_state */), | 139 !delegate->IsTouchscreenEnabledInPrefs(false /* use_local_state */), |
| 140 false /* use_local_state */); | 140 false /* use_local_state */); |
| 141 delegate->UpdateTouchscreenStatusFromPrefs(); | 141 delegate->UpdateTouchscreenStatusFromPrefs(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void HandleToggleTouchView() { | 144 void HandleToggleTouchView() { |
| 145 MaximizeModeController* controller = | 145 MaximizeModeController* controller = |
| 146 WmShell::Get()->maximize_mode_controller(); | 146 WmShell::Get()->maximize_mode_controller(); |
| 147 controller->EnableMaximizeModeWindowManager( | 147 controller->EnableMaximizeModeWindowManager( |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 case DEBUG_TRIGGER_CRASH: | 207 case DEBUG_TRIGGER_CRASH: |
| 208 HandleTriggerCrash(); | 208 HandleTriggerCrash(); |
| 209 break; | 209 break; |
| 210 default: | 210 default: |
| 211 break; | 211 break; |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 | 214 |
| 215 } // namespace debug | 215 } // namespace debug |
| 216 } // namespace ash | 216 } // namespace ash |
| OLD | NEW |