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

Unified Diff: chrome/browser/ui/webui/screenshot_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: nits 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/screenshot_source.cc
===================================================================
--- chrome/browser/ui/webui/screenshot_source.cc (revision 176443)
+++ chrome/browser/ui/webui/screenshot_source.cc (working copy)
@@ -20,6 +20,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -65,8 +66,7 @@
ScreenshotSource::ScreenshotSource(
std::vector<unsigned char>* current_screenshot,
Profile* profile)
- : DataSource(chrome::kChromeUIScreenshotPath, MessageLoop::current()),
- profile_(profile) {
+ : profile_(profile) {
// Setup the last screenshot taken.
if (current_screenshot)
current_screenshot_.reset(new ScreenshotData(*current_screenshot));
@@ -140,6 +140,10 @@
#endif
+std::string ScreenshotSource::GetSource() {
+ return chrome::kChromeUIScreenshotPath;
+}
+
void ScreenshotSource::StartDataRequest(const std::string& path, bool,
int request_id) {
SendScreenshot(path, request_id);
@@ -261,5 +265,6 @@
std::string path = screenshot_path.substr(
0, screenshot_path.find_first_of("?"));
cached_screenshots_[path] = bytes;
- SendResponse(request_id, new base::RefCountedBytes(*bytes));
+ url_data_source()->SendResponse(
+ request_id, new base::RefCountedBytes(*bytes));
}

Powered by Google App Engine
This is Rietveld 408576698