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 #ifndef ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_RESOURCES_H_ | 5 #ifndef ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_RESOURCES_H_ |
6 #define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_RESOURCES_H_ | 6 #define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_RESOURCES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 enum WallpaperLayout { | 15 enum WallpaperLayout { |
16 CENTER, | 16 CENTER, |
17 CENTER_CROPPED, | 17 CENTER_CROPPED, |
18 STRETCH, | 18 STRETCH, |
19 TILE, | 19 TILE, |
20 }; | 20 }; |
21 | 21 |
| 22 enum WallpaperResolution { |
| 23 LARGE, |
| 24 SMALL |
| 25 }; |
| 26 |
| 27 // Encapsulates wallpaper infomation needed by desktop background view. |
| 28 struct ASH_EXPORT WallpaperViewInfo { |
| 29 int id; |
| 30 WallpaperLayout layout; |
| 31 }; |
| 32 |
22 struct ASH_EXPORT WallpaperInfo { | 33 struct ASH_EXPORT WallpaperInfo { |
23 int id; | 34 WallpaperViewInfo large; |
| 35 WallpaperViewInfo small; |
24 int thumb_id; | 36 int thumb_id; |
25 WallpaperLayout layout; | |
26 // TODO(bshe): author member should be encoded to UTF16. We need to use i18n | 37 // TODO(bshe): author member should be encoded to UTF16. We need to use i18n |
27 // string for this member after M19. | 38 // string for this member after M19. |
28 const char* author; | 39 const char* author; |
29 const char* website; | 40 const char* website; |
30 }; | 41 }; |
31 | 42 |
32 const SkColor kLoginWallpaperColor = 0xFEFEFE; | 43 const SkColor kLoginWallpaperColor = 0xFEFEFE; |
33 | 44 |
34 ASH_EXPORT int GetDefaultWallpaperIndex(); | 45 ASH_EXPORT int GetDefaultWallpaperIndex(); |
35 ASH_EXPORT int GetGuestWallpaperIndex(); | 46 ASH_EXPORT int GetGuestWallpaperIndex(); |
36 ASH_EXPORT int GetInvalidWallpaperIndex(); | 47 ASH_EXPORT int GetInvalidWallpaperIndex(); |
37 ASH_EXPORT WallpaperLayout GetLayoutEnum(const std::string& layout); | 48 ASH_EXPORT WallpaperLayout GetLayoutEnum(const std::string& layout); |
38 ASH_EXPORT int GetNextWallpaperIndex(int index); | 49 ASH_EXPORT int GetNextWallpaperIndex(int index); |
39 ASH_EXPORT int GetSolidColorIndex(); | 50 ASH_EXPORT int GetSolidColorIndex(); |
40 ASH_EXPORT int GetWallpaperCount(); | 51 ASH_EXPORT int GetWallpaperCount(); |
41 ASH_EXPORT const WallpaperInfo& GetWallpaperInfo(int index); | 52 ASH_EXPORT const WallpaperInfo& GetWallpaperInfo(int index); |
| 53 ASH_EXPORT const WallpaperViewInfo& GetWallpaperViewInfo(int index, |
| 54 WallpaperResolution resolution); |
42 | 55 |
43 } // namespace ash | 56 } // namespace ash |
44 | 57 |
45 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_RESOURCES_H_ | 58 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_RESOURCES_H_ |
OLD | NEW |