Chromium Code Reviews| 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://wallpaper/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://wallpaper/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); | |
|
James Hawkins
2012/04/20 19:40:17
I'm assuming |wallpaper_index| must not be NULL.
James Hawkins
2012/04/20 19:40:17
|url| must not be empty?
bshe
2012/04/20 21:11:43
Done.
bshe
2012/04/20 21:11:43
|url| seems can be empty but can't be null.
| |
| 26 | |
| 27 // A DataSource for chrome://wallpaper/ URLs. | |
| 28 class WallpaperThumbnailSource : public ChromeURLDataManager::DataSource { | |
| 29 public: | |
| 30 WallpaperThumbnailSource(); | |
| 31 | |
| 32 // Overridden from ChromeURLDataManager::DataSource: | |
|
James Hawkins
2012/04/20 19:40:17
nit: ChromeURLDataManager::DataSource implementati
bshe
2012/04/20 21:11:43
Done.
| |
| 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 |