OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_WALLPAPER_THUMBNAIL_SOURCE2_H_ | |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_WALLPAPER_THUMBNAIL_SOURCE2_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "base/compiler_specific.h" | |
12 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | |
13 | |
14 namespace chromeos { | |
15 namespace options2 { | |
16 | |
17 // Returns a string consisting of the prefix specified and the index of the | |
18 // image. For example: chrome://wallpapers/default_2. | |
19 std::string GetDefaultWallpaperThumbnailURL(int index); | |
20 | |
21 // Checks if the given URL points to one of the default wallpapers. If it is, | |
22 // returns true and sets |wallpaper_index| to the corresponding index parsed | |
23 // from URL. For example: chrome://wallpapers/default_2 will set | |
24 // |wallpaper_index| to 2. If not a default wallpaper url, returns false. | |
25 bool IsDefaultWallpaperURL(const std::string url, int* wallpaper_index); | |
26 | |
27 // A DataSource for chrome://wallpapers/ URLs. | |
flackr
2012/04/20 16:58:18
s/wallpapers/wallpaper (all instances)
| |
28 class WallpaperThumbnailSource : public ChromeURLDataManager::DataSource { | |
29 public: | |
30 WallpaperThumbnailSource(); | |
31 | |
32 // Overridden from ChromeURLDataManager::DataSource: | |
33 virtual void StartDataRequest(const std::string& path, | |
34 bool is_incognito, | |
35 int request_id) OVERRIDE; | |
36 virtual std::string GetMimeType(const std::string&) const OVERRIDE; | |
37 | |
38 private: | |
39 virtual ~WallpaperThumbnailSource(); | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(WallpaperThumbnailSource); | |
42 }; | |
43 | |
44 } // namespace options2 | |
45 } // namespace chromeos | |
46 | |
47 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_WALLPAPER_THUMBNAIL_SOURCE2 _H_ | |
OLD | NEW |