summaryrefslogtreecommitdiffstats
path: root/ash/desktop_background
diff options
context:
space:
mode:
authorsaintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-24 00:13:51 +0000
committersaintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-24 00:13:51 +0000
commitf1cde9bce71668a0fa47413780ce2d74b4d10f9b (patch)
treebfb21977c4f493b35f27b633318a8a689d045d75 /ash/desktop_background
parent106816845b891a0cf3d82fdc65b4f80ccb067ee7 (diff)
downloadchromium_src-f1cde9bce71668a0fa47413780ce2d74b4d10f9b.zip
chromium_src-f1cde9bce71668a0fa47413780ce2d74b4d10f9b.tar.gz
chromium_src-f1cde9bce71668a0fa47413780ce2d74b4d10f9b.tar.bz2
Added method to retrieve non-random incognito wallpaper.
TBR=ben@chromium.org (for OWNERS on non-ash file). BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/9808095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128618 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/desktop_background')
-rw-r--r--ash/desktop_background/desktop_background_resources.cc9
-rw-r--r--ash/desktop_background/desktop_background_resources.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/ash/desktop_background/desktop_background_resources.cc b/ash/desktop_background/desktop_background_resources.cc
index e60125c..ae06c7c 100644
--- a/ash/desktop_background/desktop_background_resources.cc
+++ b/ash/desktop_background/desktop_background_resources.cc
@@ -564,10 +564,14 @@ const ash::WallpaperInfo kDefaultWallpapers[] = {
const int kDefaultWallpaperCount = arraysize(kDefaultWallpapers);
+// TODO(saintlou): These hardcoded indexes, although checked against the size
+// of the array are really hacky.
#if defined(GOOGLE_CHROME_BUILD)
const int kLastRandomWallpaperIndex = 12;
+const int kIcognitoWallpaperIndex = 0;
#else
const int kDefaultWallpaperIndex = 0;
+const int kIcognitoWallpaperIndex = kDefaultWallpaperIndex;
#endif
} // namespace
@@ -584,6 +588,11 @@ int GetDefaultWallpaperIndex() {
#endif
}
+int GetIncognitoWallpaperIndex() {
+ DCHECK(kIcognitoWallpaperIndex < kDefaultWallpaperCount);
+ return std::min(kIcognitoWallpaperIndex, kDefaultWallpaperCount - 1);
+}
+
int GetWallpaperCount() {
return kDefaultWallpaperCount;
}
diff --git a/ash/desktop_background/desktop_background_resources.h b/ash/desktop_background/desktop_background_resources.h
index 8170b54..d439acd 100644
--- a/ash/desktop_background/desktop_background_resources.h
+++ b/ash/desktop_background/desktop_background_resources.h
@@ -29,6 +29,7 @@ struct ASH_EXPORT WallpaperInfo {
};
ASH_EXPORT int GetDefaultWallpaperIndex();
+ASH_EXPORT int GetIncognitoWallpaperIndex();
ASH_EXPORT int GetWallpaperCount();
ASH_EXPORT const SkBitmap& GetWallpaper(int index);
ASH_EXPORT const SkBitmap& GetWallpaperThumbnail(int index);