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/mus/wallpaper_delegate_mus.h" | 5 #include "ash/mus/wallpaper_delegate_mus.h" |
6 | 6 |
7 #include "ash/common/wallpaper/wallpaper_controller.h" | 7 #include "ash/common/wallpaper/wallpaper_controller.h" |
8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
9 #include "components/wallpaper/wallpaper_layout.h" | 9 #include "components/wallpaper/wallpaper_layout.h" |
10 #include "services/shell/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
11 #include "ui/wm/core/window_animations.h" | 11 #include "ui/wm/core/window_animations.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // TODO(msw): Use enum traits instead. | 15 // TODO(msw): Use enum traits instead. |
16 wallpaper::WallpaperLayout WallpaperLayoutFromMojo( | 16 wallpaper::WallpaperLayout WallpaperLayoutFromMojo( |
17 ash::mojom::WallpaperLayout layout) { | 17 ash::mojom::WallpaperLayout layout) { |
18 switch (layout) { | 18 switch (layout) { |
19 case ash::mojom::WallpaperLayout::CENTER: | 19 case ash::mojom::WallpaperLayout::CENTER: |
20 return wallpaper::WALLPAPER_LAYOUT_CENTER; | 20 return wallpaper::WALLPAPER_LAYOUT_CENTER; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 void WallpaperDelegateMus::SetWallpaper(const SkBitmap& wallpaper, | 81 void WallpaperDelegateMus::SetWallpaper(const SkBitmap& wallpaper, |
82 mojom::WallpaperLayout layout) { | 82 mojom::WallpaperLayout layout) { |
83 if (wallpaper.isNull()) | 83 if (wallpaper.isNull()) |
84 return; | 84 return; |
85 gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(wallpaper); | 85 gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(wallpaper); |
86 WmShell::Get()->wallpaper_controller()->SetWallpaperImage( | 86 WmShell::Get()->wallpaper_controller()->SetWallpaperImage( |
87 image, WallpaperLayoutFromMojo(layout)); | 87 image, WallpaperLayoutFromMojo(layout)); |
88 } | 88 } |
89 | 89 |
90 } // namespace ash | 90 } // namespace ash |
OLD | NEW |