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

Unified Diff: ash/mus/sysui_application.cc

Issue 1984433002: Hook up Chrome's wallpaper picker for mash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gyp builds; address Sadrul's comment. Created 4 years, 7 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/sysui_application.cc
diff --git a/ash/mus/sysui_application.cc b/ash/mus/sysui_application.cc
index a43fb159f9ff270935e56f2571062d269fb66399..da95f91d3fec50def3ea3e8b3f12b97f32b6f8a2 100644
--- a/ash/mus/sysui_application.cc
+++ b/ash/mus/sysui_application.cc
@@ -9,7 +9,7 @@
#include <string>
#include <vector>
-#include "ash/desktop_background/desktop_background_controller.h"
+#include "ash/display/display_manager.h"
#include "ash/host/ash_window_tree_host_init_params.h"
#include "ash/host/ash_window_tree_host_platform.h"
#include "ash/material_design/material_design_controller.h"
@@ -18,6 +18,7 @@
#include "ash/mus/shelf_delegate_mus.h"
#include "ash/mus/shell_delegate_mus.h"
#include "ash/mus/stub_context_factory.h"
+#include "ash/mus/user_wallpaper_delegate_mus.h"
#include "ash/root_window_settings.h"
#include "ash/shell.h"
#include "ash/shell_init_params.h"
@@ -34,6 +35,8 @@
#include "ui/aura/env.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
+#include "ui/display/display.h"
+#include "ui/display/screen.h"
#include "ui/message_center/message_center.h"
#include "ui/platform_window/stub/stub_window.h"
#include "ui/views/mus/aura_init.h"
@@ -237,7 +240,6 @@ class AshInit {
ash::user::LOGGED_IN_USER);
ash::Shell::GetPrimaryRootWindow()->GetHost()->Show();
- SetupWallpaper(SkColorSetARGB(255, 0, 255, 0));
}
void InitializeResourceBundle(::shell::Connector* connector) {
@@ -266,24 +268,6 @@ class AshInit {
ui::SCALE_FACTOR_200P);
}
- void SetupWallpaper(SkColor color) {
James Cook 2016/05/19 22:29:59 So nice to see this going away!
msw 2016/05/20 19:53:05 Acknowledged.
- SkBitmap bitmap;
- bitmap.allocN32Pixels(16, 16);
- bitmap.eraseColor(color);
-#if !defined(NDEBUG)
- // In debug builds we generate a simple pattern that allows visually
- // notice if transparency is broken.
- {
- SkAutoLockPixels alp(bitmap);
- *bitmap.getAddr32(0, 0) = SkColorSetRGB(0, 0, 0);
- }
-#endif
- gfx::ImageSkia wallpaper = gfx::ImageSkia::CreateFrom1xBitmap(bitmap);
- ash::Shell::GetInstance()
- ->desktop_background_controller()
- ->SetWallpaperImage(wallpaper, wallpaper::WALLPAPER_LAYOUT_TILE);
- }
-
void InitializeComponents() {
message_center::MessageCenter::Initialize();
@@ -320,16 +304,26 @@ void SysUIApplication::Initialize(::shell::Connector* connector,
bool SysUIApplication::AcceptConnection(::shell::Connection* connection) {
connection->AddInterface<mash::shelf::mojom::ShelfController>(this);
+ connection->AddInterface<mash::mojom::WallpaperController>(this);
return true;
}
void SysUIApplication::Create(
::shell::Connection* connection,
- mojo::InterfaceRequest<mash::shelf::mojom::ShelfController> request) {
+ mash::shelf::mojom::ShelfControllerRequest request) {
mash::shelf::mojom::ShelfController* shelf_controller =
static_cast<ShelfDelegateMus*>(Shell::GetInstance()->GetShelfDelegate());
shelf_controller_bindings_.AddBinding(shelf_controller, std::move(request));
}
+void SysUIApplication::Create(::shell::Connection* connection,
+ mash::mojom::WallpaperControllerRequest request) {
+ mash::mojom::WallpaperController* wallpaper_controller =
+ static_cast<UserWallpaperDelegateMus*>(
+ Shell::GetInstance()->user_wallpaper_delegate());
+ wallpaper_controller_bindings_.AddBinding(wallpaper_controller,
+ std::move(request));
+}
+
} // namespace sysui
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698