Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: ash/desktop_background/desktop_background_resources.cc

Issue 9703031: Retry landing "Enable users change desktop background image from settings page in Chromeos Aura bui… (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge to trunk Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/desktop_background/desktop_background_resources.h"
6
7 #include "base/logging.h"
8 #include "grit/ui_resources.h"
9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/image/image.h"
11 #include "third_party/skia/include/core/SkBitmap.h"
12
13 namespace {
14
15 const int kDefaultWallpaperResources[] = {
16 IDR_AURA_WALLPAPER,
17 IDR_AURA_WALLPAPER_1,
18 IDR_AURA_WALLPAPER_2,
19 IDR_AURA_WALLPAPER_3,
20 IDR_AURA_WALLPAPER_4,
21 IDR_AURA_WALLPAPER_5,
22 IDR_AURA_WALLPAPER_6,
23 IDR_AURA_WALLPAPER_7,
24 IDR_AURA_WALLPAPER_8,
25 };
26
27 const int kDefaultWallpaperResourcesThumb[] = {
28 IDR_AURA_WALLPAPER_THUMB,
29 IDR_AURA_WALLPAPER_1_THUMB,
30 IDR_AURA_WALLPAPER_2_THUMB,
31 IDR_AURA_WALLPAPER_3_THUMB,
32 IDR_AURA_WALLPAPER_4_THUMB,
33 IDR_AURA_WALLPAPER_5_THUMB,
34 IDR_AURA_WALLPAPER_6_THUMB,
35 IDR_AURA_WALLPAPER_7_THUMB,
36 IDR_AURA_WALLPAPER_8_THUMB,
37 };
38
39 const int kDefaultWallpaperCount = arraysize(kDefaultWallpaperResources);
40
41 const int kDefaultWallpaperIndex = 0;
42
43 } // namespace
44
45 namespace ash {
46
47 int GetDefaultWallpaperIndex() {
48 return kDefaultWallpaperIndex;
49 }
50
51 int GetWallpaperCount() {
52 return kDefaultWallpaperCount;
53 }
54
55 const SkBitmap& GetWallpaper(int index) {
56 DCHECK(index >= 0 && index < kDefaultWallpaperCount);
57 return *ui::ResourceBundle::GetSharedInstance().GetImageNamed(
58 kDefaultWallpaperResources[index]).ToSkBitmap();
59 }
60
61 const SkBitmap& GetWallpaperThumbnail(int index) {
62 DCHECK(index >= 0 && index < kDefaultWallpaperCount);
63 return *ui::ResourceBundle::GetSharedInstance().GetImageNamed(
64 kDefaultWallpaperResourcesThumb[index]).ToSkBitmap();
65 }
66
67 } // namespace ash
OLDNEW
« no previous file with comments | « ash/desktop_background/desktop_background_resources.h ('k') | ash/desktop_background/desktop_background_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698