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

Unified Diff: chrome/browser/android/devtools_server.cc

Issue 10985041: DevTools: request page thumbnails from the devtools handler delegate, do not redirect to chrome://t… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android delegate updated. Created 8 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/debugger/browser_list_tabcontents_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/devtools_server.cc
diff --git a/chrome/browser/android/devtools_server.cc b/chrome/browser/android/devtools_server.cc
index e1649a362691595618befa5aa06e1230952422fc..e240885bc9ca8aef5a45d084c510baec1fb39ce9 100644
--- a/chrome/browser/android/devtools_server.cc
+++ b/chrome/browser/android/devtools_server.cc
@@ -57,6 +57,19 @@ class DevToolsServerDelegate : public content::DevToolsHttpHandlerDelegate {
return "";
}
+ virtual std::string GetPageThumbnailData(const GURL& url) {
+ Profile* profile =
+ ProfileManager::GetLastUsedProfile()->GetOriginalProfile();
+ history::TopSites* top_sites = profile->GetTopSites();
+ if (top_sites) {
+ scoped_refptr<base::RefCountedMemory> data;
+ if (top_sites->GetPageThumbnail(url, &data))
+ return std::string(reinterpret_cast<const char*>(data->front()),
+ data->size());
+ }
+ return "";
+ }
+
private:
static void PopulatePageThumbnails() {
Profile* profile =
« no previous file with comments | « no previous file | chrome/browser/debugger/browser_list_tabcontents_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698