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

Unified Diff: chrome/browser/ui/webui/options/chromeos/wallpaper_source.cc

Issue 11885021: Don't derive from ChromeURLDataManager::DataSource, and instead have these classes implement a dele… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/chromeos/wallpaper_source.cc
===================================================================
--- chrome/browser/ui/webui/options/chromeos/wallpaper_source.cc (revision 176443)
+++ chrome/browser/ui/webui/options/chromeos/wallpaper_source.cc (working copy)
@@ -10,6 +10,7 @@
#include "base/synchronization/cancellation_flag.h"
#include "base/threading/worker_pool.h"
#include "chrome/browser/chromeos/login/user_manager.h"
+#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/browser_thread.h"
#include "grit/ui_resources.h"
@@ -94,13 +95,16 @@
};
WallpaperImageSource::WallpaperImageSource()
- : DataSource(chrome::kChromeUIWallpaperImageHost, NULL),
- weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
+ : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
}
WallpaperImageSource::~WallpaperImageSource() {
}
+std::string WallpaperImageSource::GetSource() {
+ return chrome::kChromeUIWallpaperImageHost;
+}
+
void WallpaperImageSource::StartDataRequest(const std::string& email,
bool is_incognito,
int request_id) {
@@ -163,7 +167,7 @@
// Set canceled flag of previous request to skip unneeded encoding.
if (wallpaper_encoding_op_.get()) {
wallpaper_encoding_op_->Cancel();
- SendResponse(wallpaper_encoding_op_->request_id(), NULL);
+ url_data_source()->SendResponse(wallpaper_encoding_op_->request_id(), NULL);
TRACE_EVENT_ASYNC_END0("SCREEN_LOCK", "GetUserWallpaper",
wallpaper_encoding_op_->request_id());
}
@@ -175,7 +179,7 @@
void WallpaperImageSource::SendCurrentUserWallpaper(int request_id,
scoped_refptr<base::RefCountedBytes> data) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
- SendResponse(request_id, data);
+ url_data_source()->SendResponse(request_id, data);
TRACE_EVENT_ASYNC_END0("SCREEN_LOCK", "GetUserWallpaper", request_id);
}

Powered by Google App Engine
This is Rietveld 408576698