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

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: James' review 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
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..8cecdb9a7de6f65455e78f5ed56f8e582de4b435 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 layout) {
wallpaper_ = wallpaper;
- image_layout_ = layout;
+ wallpaper_layout_ = 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,7 +127,8 @@ 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 layout) {
flackr 2012/05/09 21:26:16 As before, s/layout/wallpaper_layout.
bshe 2012/05/10 16:10:26 Done.
views::Widget* desktop_widget = new views::Widget;
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);

Powered by Google App Engine
This is Rietveld 408576698