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

Unified Diff: chrome/browser/ui/webui/fileicon_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/fileicon_source.cc
===================================================================
--- chrome/browser/ui/webui/fileicon_source.cc (revision 176443)
+++ chrome/browser/ui/webui/fileicon_source.cc (working copy)
@@ -13,6 +13,7 @@
#include "base/string_split.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "chrome/browser/ui/webui/web_ui_util.h"
#include "chrome/common/time_format.h"
#include "googleurl/src/gurl.h"
@@ -90,8 +91,7 @@
} // namespace
-FileIconSource::FileIconSource()
- : DataSource(kFileIconPath, MessageLoop::current()) {}
+FileIconSource::FileIconSource() {}
FileIconSource::~FileIconSource() {}
@@ -108,7 +108,7 @@
icon->ToImageSkia()->GetRepresentation(scale_factor).sk_bitmap(),
false, &icon_data->data());
- SendResponse(request_id, icon_data);
+ url_data_source()->SendResponse(request_id, icon_data);
} else {
// Attach the ChromeURLDataManager request ID to the history request.
IconRequestDetails details;
@@ -124,6 +124,10 @@
}
}
+std::string FileIconSource::GetSource() {
+ return kFileIconPath;
+}
+
void FileIconSource::StartDataRequest(const std::string& url_path,
bool is_incognito,
int request_id) {
@@ -151,9 +155,9 @@
false,
&icon_data->data());
- SendResponse(details.request_id, icon_data);
+ url_data_source()->SendResponse(details.request_id, icon_data);
} else {
// TODO(glen): send a dummy icon.
- SendResponse(details.request_id, NULL);
+ url_data_source()->SendResponse(details.request_id, NULL);
}
}

Powered by Google App Engine
This is Rietveld 408576698