diff options
author | bshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-20 17:17:38 +0000 |
---|---|---|
committer | bshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-20 17:17:38 +0000 |
commit | 0c3461ab36efb7744df197f7029d66c3170a61f3 (patch) | |
tree | 5c11004cd470a1f028548e9139738d9cd7c528fb /ash/desktop_background/desktop_background_view.cc | |
parent | 2dca2dc97fd303df0c6a1fb11828472ef1c00428 (diff) | |
download | chromium_src-0c3461ab36efb7744df197f7029d66c3170a61f3.zip chromium_src-0c3461ab36efb7744df197f7029d66c3170a61f3.tar.gz chromium_src-0c3461ab36efb7744df197f7029d66c3170a61f3.tar.bz2 |
Remove use of index in wallpaper picker code and some refactor
BUG=141431
Review URL: https://codereview.chromium.org/11415015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/desktop_background/desktop_background_view.cc')
-rw-r--r-- | ash/desktop_background/desktop_background_view.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc index 99b22dd..86175a4 100644 --- a/ash/desktop_background/desktop_background_view.cc +++ b/ash/desktop_background/desktop_background_view.cc @@ -128,8 +128,8 @@ void DesktopBackgroundView::OnPaint(gfx::Canvas* canvas) { WallpaperLayout wallpaper_layout = controller->GetWallpaperLayout(); gfx::Rect wallpaper_rect(0, 0, wallpaper.width(), wallpaper.height()); - if (wallpaper_layout == ash::CENTER_CROPPED && wallpaper.width() > width() - && wallpaper.height() > height()) { + if (wallpaper_layout == WALLPAPER_LAYOUT_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. double horizontal_ratio = static_cast<double>(width()) / @@ -154,9 +154,9 @@ void DesktopBackgroundView::OnPaint(gfx::Canvas* canvas) { wallpaper_cropped_rect.width(), wallpaper_cropped_rect.height(), 0, 0, width(), height(), true); - } else if (wallpaper_layout == ash::TILE) { + } else if (wallpaper_layout == WALLPAPER_LAYOUT_TILE) { canvas->TileImageInt(wallpaper, 0, 0, width(), height()); - } else if (wallpaper_layout == ash::STRETCH) { + } else if (wallpaper_layout == WALLPAPER_LAYOUT_STRETCH) { // This is generally not recommended as it may show artifacts. canvas->DrawImageInt(wallpaper, 0, 0, wallpaper.width(), wallpaper.height(), 0, 0, width(), height(), true); |