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

Unified Diff: ash/desktop_background/desktop_background_view.cc

Issue 10375010: Implement user selected wallpaper feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 8 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
« no previous file with comments | « ash/desktop_background/desktop_background_view.h ('k') | ash/shell_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/desktop_background/desktop_background_view.cc
diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc
index 80e3ce0591098dc38d4ac024056922d6a34d34c9..c1c08d8235f82cbe41ace2381c5673216db685c3 100644
--- a/ash/desktop_background/desktop_background_view.cc
+++ b/ash/desktop_background/desktop_background_view.cc
@@ -61,9 +61,9 @@ static int RoundPositive(double x) {
// DesktopBackgroundView, public:
DesktopBackgroundView::DesktopBackgroundView(const SkBitmap& wallpaper,
- ImageLayout layout) {
+ WallpaperLayout wallpaper_layout) {
wallpaper_ = wallpaper;
- image_layout_ = layout;
+ wallpaper_layout_ = wallpaper_layout;
wallpaper_.buildMipMap(false);
}
@@ -80,7 +80,7 @@ void DesktopBackgroundView::OnPaint(gfx::Canvas* canvas) {
// streching to avoid upsampling artifacts (Note that we could tile too, but
// decided not to do this at the moment).
gfx::Rect wallpaper_rect(0, 0, wallpaper_.width(), wallpaper_.height());
- if (image_layout_ == ash::CENTER_CROPPED && wallpaper_.width() > width()
+ if (wallpaper_layout_ == ash::CENTER_CROPPED && wallpaper_.width() > width()
&& wallpaper_.height() > height()) {
// The dimension with the smallest ratio must be cropped, the other one
// is preserved. Both are set in gfx::Size cropped_size.
@@ -105,9 +105,9 @@ void DesktopBackgroundView::OnPaint(gfx::Canvas* canvas) {
wallpaper_cropped_rect.width(), wallpaper_cropped_rect.height(),
0, 0, width(), height(),
true);
- } else if (image_layout_ == ash::TILE) {
+ } else if (wallpaper_layout_ == ash::TILE) {
canvas->TileImageInt(wallpaper_, 0, 0, width(), height());
- } else if (image_layout_ == ash::STRETCH) {
+ } else if (wallpaper_layout_ == ash::STRETCH) {
// This is generally not recommended as it may show artifacts.
canvas->DrawBitmapInt(wallpaper_, 0, 0, wallpaper_.width(),
wallpaper_.height(), 0, 0, width(), height(), true);
@@ -127,11 +127,13 @@ void DesktopBackgroundView::OnMouseReleased(const views::MouseEvent& event) {
Shell::GetInstance()->ShowBackgroundMenu(GetWidget(), event.location());
}
-void CreateDesktopBackground(const SkBitmap& wallpaper, ImageLayout layout) {
+void CreateDesktopBackground(const SkBitmap& wallpaper,
+ WallpaperLayout wallpaper_layout) {
views::Widget* desktop_widget = new views::Widget;
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
- DesktopBackgroundView* view = new DesktopBackgroundView(wallpaper, layout);
+ DesktopBackgroundView* view = new DesktopBackgroundView(wallpaper,
+ wallpaper_layout);
params.delegate = view;
params.parent =
Shell::GetInstance()->GetContainer(
« no previous file with comments | « ash/desktop_background/desktop_background_view.h ('k') | ash/shell_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698