From a24bee52b57a70e9e1f18fa72ce67bb5d74ff796 Mon Sep 17 00:00:00 2001 From: "saintlou@chromium.org" Date: Fri, 23 Mar 2012 23:18:28 +0000 Subject: A random wallpaper will be picked when building Chrome, but nor Chromium. BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/9839076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128605 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/desktop_background/desktop_background_resources.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ash') diff --git a/ash/desktop_background/desktop_background_resources.cc b/ash/desktop_background/desktop_background_resources.cc index 8d5c654..e60125c 100644 --- a/ash/desktop_background/desktop_background_resources.cc +++ b/ash/desktop_background/desktop_background_resources.cc @@ -5,6 +5,7 @@ #include "ash/desktop_background/desktop_background_resources.h" #include "base/logging.h" +#include "base/rand_util.h" #include "grit/ui_resources.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" @@ -562,14 +563,25 @@ const ash::WallpaperInfo kDefaultWallpapers[] = { }; const int kDefaultWallpaperCount = arraysize(kDefaultWallpapers); + +#if defined(GOOGLE_CHROME_BUILD) +const int kLastRandomWallpaperIndex = 12; +#else const int kDefaultWallpaperIndex = 0; +#endif } // namespace namespace ash { int GetDefaultWallpaperIndex() { +#if defined(GOOGLE_CHROME_BUILD) + DCHECK(kLastRandomWallpaperIndex < kDefaultWallpaperCount); + return base::RandInt(0, + std::min(kLastRandomWallpaperIndex, kDefaultWallpaperCount - 1)); +#else return kDefaultWallpaperIndex; +#endif } int GetWallpaperCount() { -- cgit v1.1