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

Unified Diff: ash/mus/wallpaper_delegate_mus.cc

Issue 2413503002: Cleanup mojo Wallpaper interfaces for mash. (Closed)
Patch Set: Sync and rebase again... 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
« no previous file with comments | « ash/mus/wallpaper_delegate_mus.h ('k') | ash/mus/window_manager_application.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/wallpaper_delegate_mus.cc
diff --git a/ash/mus/wallpaper_delegate_mus.cc b/ash/mus/wallpaper_delegate_mus.cc
index a6dedd2d271a7ee2be1f1a7d48329a4478dddaca..88f4695034c6f3d501f9367f157ac5fd6fc7c5fb 100644
--- a/ash/mus/wallpaper_delegate_mus.cc
+++ b/ash/mus/wallpaper_delegate_mus.cc
@@ -4,39 +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/service_manager/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(
- service_manager::Connector* connector)
- : connector_(connector) {}
-
+WallpaperDelegateMus::WallpaperDelegateMus() {}
WallpaperDelegateMus::~WallpaperDelegateMus() {}
int WallpaperDelegateMus::GetAnimationType() {
@@ -64,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;
@@ -79,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
« no previous file with comments | « ash/mus/wallpaper_delegate_mus.h ('k') | ash/mus/window_manager_application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698