| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_delegate_aura.h" | 5 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "ash/accelerators/accelerator_commands_aura.h" | 12 #include "ash/accelerators/accelerator_commands_aura.h" |
| 13 #include "ash/common/accelerators/debug_commands.h" | 13 #include "ash/common/accelerators/debug_commands.h" |
| 14 #include "ash/common/accessibility_types.h" | 14 #include "ash/common/accessibility_types.h" |
| 15 #include "ash/common/ash_switches.h" | 15 #include "ash/common/ash_switches.h" |
| 16 #include "ash/common/focus_cycler.h" | 16 #include "ash/common/focus_cycler.h" |
| 17 #include "ash/common/gpu_support.h" | 17 #include "ash/common/gpu_support.h" |
| 18 #include "ash/common/session/session_state_delegate.h" | 18 #include "ash/common/session/session_state_delegate.h" |
| 19 #include "ash/common/shelf/shelf.h" | 19 #include "ash/common/shelf/shelf.h" |
| 20 #include "ash/common/shelf/shelf_widget.h" | 20 #include "ash/common/shelf/shelf_widget.h" |
| 21 #include "ash/common/shell_delegate.h" | 21 #include "ash/common/shell_delegate.h" |
| 22 #include "ash/common/shell_window_ids.h" | 22 #include "ash/common/shell_window_ids.h" |
| 23 #include "ash/common/system/status_area_widget.h" | 23 #include "ash/common/system/status_area_widget.h" |
| 24 #include "ash/common/system/system_notifier.h" | 24 #include "ash/common/system/system_notifier.h" |
| 25 #include "ash/common/system/tray/system_tray.h" | 25 #include "ash/common/system/tray/system_tray.h" |
| 26 #include "ash/common/system/web_notification/web_notification_tray.h" | 26 #include "ash/common/system/web_notification/web_notification_tray.h" |
| 27 #include "ash/common/wallpaper/wallpaper_delegate.h" |
| 27 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 28 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 28 #include "ash/common/wm/window_state.h" | 29 #include "ash/common/wm/window_state.h" |
| 29 #include "ash/common/wm/wm_event.h" | 30 #include "ash/common/wm/wm_event.h" |
| 30 #include "ash/common/wm_shell.h" | 31 #include "ash/common/wm_shell.h" |
| 31 #include "ash/debug.h" | 32 #include "ash/debug.h" |
| 32 #include "ash/desktop_background/desktop_background_controller.h" | 33 #include "ash/desktop_background/desktop_background_controller.h" |
| 33 #include "ash/desktop_background/user_wallpaper_delegate.h" | |
| 34 #include "ash/display/display_manager.h" | 34 #include "ash/display/display_manager.h" |
| 35 #include "ash/display/window_tree_host_manager.h" | 35 #include "ash/display/window_tree_host_manager.h" |
| 36 #include "ash/host/ash_window_tree_host.h" | 36 #include "ash/host/ash_window_tree_host.h" |
| 37 #include "ash/magnifier/magnification_controller.h" | 37 #include "ash/magnifier/magnification_controller.h" |
| 38 #include "ash/magnifier/partial_magnification_controller.h" | 38 #include "ash/magnifier/partial_magnification_controller.h" |
| 39 #include "ash/root_window_controller.h" | 39 #include "ash/root_window_controller.h" |
| 40 #include "ash/rotator/screen_rotation_animator.h" | 40 #include "ash/rotator/screen_rotation_animator.h" |
| 41 #include "ash/rotator/window_rotation.h" | 41 #include "ash/rotator/window_rotation.h" |
| 42 #include "ash/screen_util.h" | 42 #include "ash/screen_util.h" |
| 43 #include "ash/screenshot_delegate.h" | 43 #include "ash/screenshot_delegate.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 canvas.DrawRoundRect(gfx::Rect(image_size), 100, paint); | 293 canvas.DrawRoundRect(gfx::Rect(image_size), 100, paint); |
| 294 return gfx::ImageSkia(canvas.ExtractImageRep()); | 294 return gfx::ImageSkia(canvas.ExtractImageRep()); |
| 295 } | 295 } |
| 296 | 296 |
| 297 void HandleToggleDesktopBackgroundMode() { | 297 void HandleToggleDesktopBackgroundMode() { |
| 298 static int index = 0; | 298 static int index = 0; |
| 299 DesktopBackgroundController* desktop_background_controller = | 299 DesktopBackgroundController* desktop_background_controller = |
| 300 Shell::GetInstance()->desktop_background_controller(); | 300 Shell::GetInstance()->desktop_background_controller(); |
| 301 switch (++index % 4) { | 301 switch (++index % 4) { |
| 302 case 0: | 302 case 0: |
| 303 ash::Shell::GetInstance() | 303 ash::WmShell::Get()->wallpaper_delegate()->InitializeWallpaper(); |
| 304 ->user_wallpaper_delegate() | |
| 305 ->InitializeWallpaper(); | |
| 306 break; | 304 break; |
| 307 case 1: | 305 case 1: |
| 308 desktop_background_controller->SetWallpaperImage( | 306 desktop_background_controller->SetWallpaperImage( |
| 309 CreateWallpaperImage(SK_ColorRED, SK_ColorBLUE), | 307 CreateWallpaperImage(SK_ColorRED, SK_ColorBLUE), |
| 310 wallpaper::WALLPAPER_LAYOUT_STRETCH); | 308 wallpaper::WALLPAPER_LAYOUT_STRETCH); |
| 311 break; | 309 break; |
| 312 case 2: | 310 case 2: |
| 313 desktop_background_controller->SetWallpaperImage( | 311 desktop_background_controller->SetWallpaperImage( |
| 314 CreateWallpaperImage(SK_ColorBLUE, SK_ColorGREEN), | 312 CreateWallpaperImage(SK_ColorBLUE, SK_ColorGREEN), |
| 315 wallpaper::WALLPAPER_LAYOUT_CENTER); | 313 wallpaper::WALLPAPER_LAYOUT_CENTER); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 message_center::NotifierId( | 651 message_center::NotifierId( |
| 654 message_center::NotifierId::SYSTEM_COMPONENT, | 652 message_center::NotifierId::SYSTEM_COMPONENT, |
| 655 system_notifier::kNotifierDeprecatedAccelerator), | 653 system_notifier::kNotifierDeprecatedAccelerator), |
| 656 message_center::RichNotificationData(), | 654 message_center::RichNotificationData(), |
| 657 new DeprecatedAcceleratorNotificationDelegate)); | 655 new DeprecatedAcceleratorNotificationDelegate)); |
| 658 message_center::MessageCenter::Get()->AddNotification( | 656 message_center::MessageCenter::Get()->AddNotification( |
| 659 std::move(notification)); | 657 std::move(notification)); |
| 660 } | 658 } |
| 661 | 659 |
| 662 } // namespace ash | 660 } // namespace ash |
| OLD | NEW |