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

Unified Diff: ash/mus/wallpaper_delegate_mus.cc

Issue 2413503002: Cleanup mojo Wallpaper interfaces for mash. (Closed)
Patch Set: Cleanup. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: ash/mus/wallpaper_delegate_mus.cc
diff --git a/ash/mus/wallpaper_delegate_mus.cc b/ash/mus/wallpaper_delegate_mus.cc
index 18d59fc725d198548a6863a80d33a8094f04bb40..88f4695034c6f3d501f9367f157ac5fd6fc7c5fb 100644
--- a/ash/mus/wallpaper_delegate_mus.cc
+++ b/ash/mus/wallpaper_delegate_mus.cc
@@ -4,38 +4,12 @@
#include "ash/mus/wallpaper_delegate_mus.h"
-#include "ash/common/wallpaper/wallpaper_controller.h"
-#include "ash/common/wm_shell.h"
#include "components/wallpaper/wallpaper_layout.h"
-#include "services/shell/public/cpp/connector.h"
#include "ui/wm/core/window_animations.h"
-namespace {
-
-// TODO(msw): Use enum traits instead.
-wallpaper::WallpaperLayout WallpaperLayoutFromMojo(
- ash::mojom::WallpaperLayout layout) {
- switch (layout) {
- case ash::mojom::WallpaperLayout::CENTER:
- return wallpaper::WALLPAPER_LAYOUT_CENTER;
- case ash::mojom::WallpaperLayout::CENTER_CROPPED:
- return wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED;
- case ash::mojom::WallpaperLayout::STRETCH:
- return wallpaper::WALLPAPER_LAYOUT_STRETCH;
- case ash::mojom::WallpaperLayout::TILE:
- return wallpaper::WALLPAPER_LAYOUT_TILE;
- }
- NOTREACHED();
- return wallpaper::WALLPAPER_LAYOUT_CENTER;
-}
-
-} // namespace
-
namespace ash {
-WallpaperDelegateMus::WallpaperDelegateMus(shell::Connector* connector)
- : connector_(connector) {}
-
+WallpaperDelegateMus::WallpaperDelegateMus() {}
WallpaperDelegateMus::~WallpaperDelegateMus() {}
int WallpaperDelegateMus::GetAnimationType() {
@@ -63,12 +37,6 @@ void WallpaperDelegateMus::InitializeWallpaper() {
// No action required; ChromeBrowserMainPartsChromeos inits WallpaperManager.
}
-void WallpaperDelegateMus::OpenSetWallpaperPage() {
- mojom::WallpaperManagerPtr wallpaper_manager;
- connector_->ConnectToInterface("service:content_browser", &wallpaper_manager);
- wallpaper_manager->Open();
-}
-
bool WallpaperDelegateMus::CanOpenSetWallpaperPage() {
// TODO(msw): Restrict this during login, etc.
return true;
@@ -78,13 +46,4 @@ void WallpaperDelegateMus::OnWallpaperAnimationFinished() {}
void WallpaperDelegateMus::OnWallpaperBootAnimationFinished() {}
-void WallpaperDelegateMus::SetWallpaper(const SkBitmap& wallpaper,
- mojom::WallpaperLayout layout) {
- if (wallpaper.isNull())
- return;
- gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(wallpaper);
- WmShell::Get()->wallpaper_controller()->SetWallpaperImage(
- image, WallpaperLayoutFromMojo(layout));
-}
-
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698