diff options
author | saintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-23 23:18:28 +0000 |
---|---|---|
committer | saintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-23 23:18:28 +0000 |
commit | a24bee52b57a70e9e1f18fa72ce67bb5d74ff796 (patch) | |
tree | 1c4a0a0beb315a382c7a937cef43c0c69cc78105 /ash/desktop_background | |
parent | b9ec6edd2d51e20d2fbe573e3b7aa723b4307afc (diff) | |
download | chromium_src-a24bee52b57a70e9e1f18fa72ce67bb5d74ff796.zip chromium_src-a24bee52b57a70e9e1f18fa72ce67bb5d74ff796.tar.gz chromium_src-a24bee52b57a70e9e1f18fa72ce67bb5d74ff796.tar.bz2 |
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
Diffstat (limited to 'ash/desktop_background')
-rw-r--r-- | ash/desktop_background/desktop_background_resources.cc | 12 |
1 files changed, 12 insertions, 0 deletions
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() { |