| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/desktop_background/desktop_background_resources.h" | 5 #include "ash/desktop_background/desktop_background_resources.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 IDR_AURA_WALLPAPERS_5_GRADIENT7, | 216 IDR_AURA_WALLPAPERS_5_GRADIENT7, |
| 217 IDR_AURA_WALLPAPERS_5_GRADIENT7_THUMB, | 217 IDR_AURA_WALLPAPERS_5_GRADIENT7_THUMB, |
| 218 ash::TILE, | 218 ash::TILE, |
| 219 "Chromium", | 219 "Chromium", |
| 220 "http://www.chromium.org" | 220 "http://www.chromium.org" |
| 221 }, | 221 }, |
| 222 }; | 222 }; |
| 223 | 223 |
| 224 const int kDefaultWallpaperCount = arraysize(kDefaultWallpapers); | 224 const int kDefaultWallpaperCount = arraysize(kDefaultWallpapers); |
| 225 const int kInvalidWallpaperIndex = -1; | 225 const int kInvalidWallpaperIndex = -1; |
| 226 const int kSolidColorIndex = -2; |
| 226 | 227 |
| 227 // TODO(saintlou): These hardcoded indexes, although checked against the size | 228 // TODO(saintlou): These hardcoded indexes, although checked against the size |
| 228 // of the array are really hacky. | 229 // of the array are really hacky. |
| 229 #if defined(GOOGLE_CHROME_BUILD) | 230 #if defined(GOOGLE_CHROME_BUILD) |
| 230 const int kDefaultWallpaperIndex = 16; // IDR_AURA_WALLPAPERS_3_URBAN0 | 231 const int kDefaultWallpaperIndex = 16; // IDR_AURA_WALLPAPERS_3_URBAN0 |
| 231 const int kLastRandomWallpaperIndex = 19; // The first 20 are random. | 232 const int kLastRandomWallpaperIndex = 19; // The first 20 are random. |
| 232 const int kGuestWallpaperIndex = 26; // IDR_AURA_WALLPAPERS_5_GRADIENT6 | 233 const int kGuestWallpaperIndex = 26; // IDR_AURA_WALLPAPERS_5_GRADIENT6 |
| 233 #else | 234 #else |
| 234 // Set default wallpaper to the grey background for faster wallpaper loading | 235 // Set default wallpaper to the grey background for faster wallpaper loading |
| 235 // time in browser tests. Otherwise, some of the tests will finish before | 236 // time in browser tests. Otherwise, some of the tests will finish before |
| 236 // wallpaper loaded and cause crashes. | 237 // wallpaper loaded and cause crashes. |
| 237 const int kDefaultWallpaperIndex = 6; // IDR_AURA_WALLPAPERS_5_GRADIENT5 | 238 const int kDefaultWallpaperIndex = 6; // IDR_AURA_WALLPAPERS_5_GRADIENT5 |
| 238 const int kLastRandomWallpaperIndex = 8; | 239 const int kLastRandomWallpaperIndex = 8; |
| 239 const int kGuestWallpaperIndex = kDefaultWallpaperIndex; | 240 const int kGuestWallpaperIndex = kDefaultWallpaperIndex; |
| 240 #endif | 241 #endif |
| 241 | 242 |
| 242 } // namespace | 243 } // namespace |
| 243 | 244 |
| 244 namespace ash { | 245 namespace ash { |
| 245 | 246 |
| 247 int GetSolidColorIndex() { |
| 248 return kSolidColorIndex; |
| 249 } |
| 250 |
| 246 int GetInvalidWallpaperIndex() { | 251 int GetInvalidWallpaperIndex() { |
| 247 return kInvalidWallpaperIndex; | 252 return kInvalidWallpaperIndex; |
| 248 } | 253 } |
| 249 | 254 |
| 250 int GetDefaultWallpaperIndex() { | 255 int GetDefaultWallpaperIndex() { |
| 251 DCHECK(kDefaultWallpaperIndex < kDefaultWallpaperCount); | 256 DCHECK(kDefaultWallpaperIndex < kDefaultWallpaperCount); |
| 252 return std::min(kDefaultWallpaperIndex, kDefaultWallpaperCount - 1); | 257 return std::min(kDefaultWallpaperIndex, kDefaultWallpaperCount - 1); |
| 253 } | 258 } |
| 254 | 259 |
| 255 int GetGuestWallpaperIndex() { | 260 int GetGuestWallpaperIndex() { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 266 int GetWallpaperCount() { | 271 int GetWallpaperCount() { |
| 267 return kDefaultWallpaperCount; | 272 return kDefaultWallpaperCount; |
| 268 } | 273 } |
| 269 | 274 |
| 270 const WallpaperInfo& GetWallpaperInfo(int index) { | 275 const WallpaperInfo& GetWallpaperInfo(int index) { |
| 271 DCHECK(index >= 0 && index < kDefaultWallpaperCount); | 276 DCHECK(index >= 0 && index < kDefaultWallpaperCount); |
| 272 return kDefaultWallpapers[index]; | 277 return kDefaultWallpapers[index]; |
| 273 } | 278 } |
| 274 | 279 |
| 275 } // namespace ash | 280 } // namespace ash |
| OLD | NEW |