Chromium Code Reviews| 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/gpu_support.h" | 16 #include "ash/common/gpu_support.h" |
| 17 #include "ash/common/session/session_state_delegate.h" | 17 #include "ash/common/session/session_state_delegate.h" |
| 18 #include "ash/common/shelf/wm_shelf.h" | 18 #include "ash/common/shelf/wm_shelf.h" |
| 19 #include "ash/common/shell_delegate.h" | 19 #include "ash/common/shell_delegate.h" |
| 20 #include "ash/common/shell_window_ids.h" | 20 #include "ash/common/shell_window_ids.h" |
| 21 #include "ash/common/system/system_notifier.h" | 21 #include "ash/common/system/system_notifier.h" |
| 22 #include "ash/common/system/tray/system_tray.h" | 22 #include "ash/common/system/tray/system_tray.h" |
| 23 #include "ash/common/wallpaper/wallpaper_controller.h" | |
| 23 #include "ash/common/wallpaper/wallpaper_delegate.h" | 24 #include "ash/common/wallpaper/wallpaper_delegate.h" |
| 24 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 25 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 25 #include "ash/common/wm/window_state.h" | 26 #include "ash/common/wm/window_state.h" |
| 26 #include "ash/common/wm/wm_event.h" | 27 #include "ash/common/wm/wm_event.h" |
| 27 #include "ash/common/wm_shell.h" | 28 #include "ash/common/wm_shell.h" |
| 28 #include "ash/debug.h" | 29 #include "ash/debug.h" |
| 29 #include "ash/display/display_manager.h" | 30 #include "ash/display/display_manager.h" |
| 30 #include "ash/display/window_tree_host_manager.h" | 31 #include "ash/display/window_tree_host_manager.h" |
| 31 #include "ash/host/ash_window_tree_host.h" | 32 #include "ash/host/ash_window_tree_host.h" |
| 32 #include "ash/magnifier/magnification_controller.h" | 33 #include "ash/magnifier/magnification_controller.h" |
| 33 #include "ash/root_window_controller.h" | 34 #include "ash/root_window_controller.h" |
| 34 #include "ash/rotator/screen_rotation_animator.h" | 35 #include "ash/rotator/screen_rotation_animator.h" |
| 35 #include "ash/rotator/window_rotation.h" | 36 #include "ash/rotator/window_rotation.h" |
| 36 #include "ash/screen_util.h" | 37 #include "ash/screen_util.h" |
| 37 #include "ash/screenshot_delegate.h" | 38 #include "ash/screenshot_delegate.h" |
| 38 #include "ash/shell.h" | 39 #include "ash/shell.h" |
| 39 #include "ash/touch/touch_hud_debug.h" | 40 #include "ash/touch/touch_hud_debug.h" |
| 40 #include "ash/utility/screenshot_controller.h" | 41 #include "ash/utility/screenshot_controller.h" |
| 41 #include "ash/wallpaper/wallpaper_controller.h" | |
| 42 #include "ash/wm/power_button_controller.h" | 42 #include "ash/wm/power_button_controller.h" |
| 43 #include "ash/wm/window_state_aura.h" | 43 #include "ash/wm/window_state_aura.h" |
| 44 #include "ash/wm/window_util.h" | 44 #include "ash/wm/window_util.h" |
| 45 #include "base/metrics/histogram_macros.h" | 45 #include "base/metrics/histogram_macros.h" |
| 46 #include "base/metrics/user_metrics.h" | 46 #include "base/metrics/user_metrics.h" |
| 47 #include "base/strings/string_split.h" | 47 #include "base/strings/string_split.h" |
| 48 #include "base/strings/utf_string_conversions.h" | 48 #include "base/strings/utf_string_conversions.h" |
| 49 #include "third_party/skia/include/core/SkColor.h" | 49 #include "third_party/skia/include/core/SkColor.h" |
| 50 #include "third_party/skia/include/core/SkPaint.h" | 50 #include "third_party/skia/include/core/SkPaint.h" |
| 51 #include "ui/base/accelerators/accelerator.h" | 51 #include "ui/base/accelerators/accelerator.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 canvas.DrawColor(fill); | 236 canvas.DrawColor(fill); |
| 237 SkPaint paint; | 237 SkPaint paint; |
| 238 paint.setColor(rect); | 238 paint.setColor(rect); |
| 239 paint.setStrokeWidth(10); | 239 paint.setStrokeWidth(10); |
| 240 paint.setStyle(SkPaint::kStroke_Style); | 240 paint.setStyle(SkPaint::kStroke_Style); |
| 241 paint.setXfermodeMode(SkXfermode::kSrcOver_Mode); | 241 paint.setXfermodeMode(SkXfermode::kSrcOver_Mode); |
| 242 canvas.DrawRoundRect(gfx::Rect(image_size), 100, paint); | 242 canvas.DrawRoundRect(gfx::Rect(image_size), 100, paint); |
| 243 return gfx::ImageSkia(canvas.ExtractImageRep()); | 243 return gfx::ImageSkia(canvas.ExtractImageRep()); |
| 244 } | 244 } |
| 245 | 245 |
| 246 void HandleToggleWallpaperMode() { | 246 void HandleToggleWallpaperMode() { |
|
James Cook
2016/09/07 21:27:05
Can this accelerator be moved to ash/common/accele
msw
2016/09/07 22:28:24
Done.
| |
| 247 static int index = 0; | 247 static int index = 0; |
| 248 WallpaperController* wallpaper_controller = | 248 WallpaperController* wallpaper_controller = |
| 249 Shell::GetInstance()->wallpaper_controller(); | 249 WmShell::Get()->wallpaper_controller(); |
| 250 switch (++index % 4) { | 250 switch (++index % 4) { |
| 251 case 0: | 251 case 0: |
| 252 ash::WmShell::Get()->wallpaper_delegate()->InitializeWallpaper(); | 252 ash::WmShell::Get()->wallpaper_delegate()->InitializeWallpaper(); |
| 253 break; | 253 break; |
| 254 case 1: | 254 case 1: |
| 255 wallpaper_controller->SetWallpaperImage( | 255 wallpaper_controller->SetWallpaperImage( |
| 256 CreateWallpaperImage(SK_ColorRED, SK_ColorBLUE), | 256 CreateWallpaperImage(SK_ColorRED, SK_ColorBLUE), |
| 257 wallpaper::WALLPAPER_LAYOUT_STRETCH); | 257 wallpaper::WALLPAPER_LAYOUT_STRETCH); |
| 258 break; | 258 break; |
| 259 case 2: | 259 case 2: |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 message_center::NotifierId( | 547 message_center::NotifierId( |
| 548 message_center::NotifierId::SYSTEM_COMPONENT, | 548 message_center::NotifierId::SYSTEM_COMPONENT, |
| 549 system_notifier::kNotifierDeprecatedAccelerator), | 549 system_notifier::kNotifierDeprecatedAccelerator), |
| 550 message_center::RichNotificationData(), | 550 message_center::RichNotificationData(), |
| 551 new DeprecatedAcceleratorNotificationDelegate)); | 551 new DeprecatedAcceleratorNotificationDelegate)); |
| 552 message_center::MessageCenter::Get()->AddNotification( | 552 message_center::MessageCenter::Get()->AddNotification( |
| 553 std::move(notification)); | 553 std::move(notification)); |
| 554 } | 554 } |
| 555 | 555 |
| 556 } // namespace ash | 556 } // namespace ash |
| OLD | NEW |