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

Unified Diff: chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.cc

Issue 2200893002: mash: Partially migrate ash/desktop_background to ash common types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mash browser test crash in GetMaxDisplaySizeInNative. Created 4 years, 4 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: chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.cc
diff --git a/chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.cc b/chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.cc
deleted file mode 100644
index c79784e6c2e2669fc483cf18a8066a3af169c10d..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.h"
-
-#include "ash/common/wm/window_animation_types.h"
-#include "ash/desktop_background/desktop_background_controller.h"
-#include "ash/desktop_background/user_wallpaper_delegate.h"
-#include "ash/shell.h"
-#include "ash/wm/window_animations.h"
-#include "base/macros.h"
-#include "ui/gfx/image/image_skia.h"
-
-namespace {
-
-const char kBackgroundRed = 70;
-const char kBackgroundGreen = 70;
-const char kBackgroundBlue = 78;
-
-class UserWallpaperDelegate : public ash::UserWallpaperDelegate {
- public:
- UserWallpaperDelegate() {
- }
-
- ~UserWallpaperDelegate() override {}
-
- int GetAnimationType() override {
- return ShouldShowInitialAnimation()
- ? ash::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE
- : static_cast<int>(wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE);
- }
-
- bool ShouldShowInitialAnimation() override { return true; }
-
- int GetAnimationDurationOverride() override {
- // Return 0 to select the default.
- return 0;
- }
-
- void SetAnimationDurationOverride(int animation_duration_in_ms) override {
- NOTIMPLEMENTED();
- }
-
- void UpdateWallpaper(bool clear_cache) override {
- SkBitmap bitmap;
- bitmap.allocN32Pixels(16, 16);
- bitmap.eraseARGB(255, kBackgroundRed, kBackgroundGreen, kBackgroundBlue);
-#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 InitializeWallpaper() override { UpdateWallpaper(false); }
-
- void OpenSetWallpaperPage() override {}
-
- bool CanOpenSetWallpaperPage() override { return false; }
-
- void OnWallpaperAnimationFinished() override {}
-
- void OnWallpaperBootAnimationFinished() override {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate);
-};
-
-} // namespace
-
-ash::UserWallpaperDelegate* CreateSolidColorUserWallpaperDelegate() {
- return new UserWallpaperDelegate();
-}
« no previous file with comments | « chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.h ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698