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

Side by Side Diff: chrome/browser/thumbnails/thumbnail_list_source.cc

Issue 870063002: Componentize TopSites, TopSitesBackend, TopSitesDatabase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@815983002
Patch Set: Fix typo Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/thumbnails/thumbnail_list_source.h" 5 #include "chrome/browser/thumbnails/thumbnail_list_source.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/ref_counted_memory.h" 12 #include "base/memory/ref_counted_memory.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "chrome/browser/history/top_sites.h"
15 #include "chrome/browser/history/top_sites_factory.h" 14 #include "chrome/browser/history/top_sites_factory.h"
16 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/search/instant_io_context.h" 16 #include "chrome/browser/search/instant_io_context.h"
18 #include "chrome/browser/thumbnails/thumbnail_service.h" 17 #include "chrome/browser/thumbnails/thumbnail_service.h"
19 #include "chrome/browser/thumbnails/thumbnail_service_factory.h" 18 #include "chrome/browser/thumbnails/thumbnail_service_factory.h"
20 #include "chrome/common/url_constants.h" 19 #include "chrome/common/url_constants.h"
20 #include "components/history/core/browser/top_sites.h"
21 #include "net/base/escape.h" 21 #include "net/base/escape.h"
22 #include "net/url_request/url_request.h" 22 #include "net/url_request/url_request.h"
23 23
24 namespace { 24 namespace {
25 25
26 const char kHtmlHeader[] = 26 const char kHtmlHeader[] =
27 "<!DOCTYPE html>\n<html>\n<head>\n<title>TopSites Thumbnails</title>\n" 27 "<!DOCTYPE html>\n<html>\n<head>\n<title>TopSites Thumbnails</title>\n"
28 "<meta charset=\"utf-8\">\n" 28 "<meta charset=\"utf-8\">\n"
29 "<style type=\"text/css\">\nimg.thumb {border: 1px solid black;}\n" 29 "<style type=\"text/css\">\nimg.thumb {border: 1px solid black;}\n"
30 "li {white-space: nowrap;}\n</style>\n"; 30 "li {white-space: nowrap;}\n</style>\n";
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 if (num_mv_with_thumb < num_mv) { 158 if (num_mv_with_thumb < num_mv) {
159 out.push_back("<h2>TopSites URLs without Thumbnails</h2>\n"); 159 out.push_back("<h2>TopSites URLs without Thumbnails</h2>\n");
160 RenderMostVisitedURLList(mvurl_list, base64_encoded_pngs, false, &out); 160 RenderMostVisitedURLList(mvurl_list, base64_encoded_pngs, false, &out);
161 } 161 }
162 out.push_back(kHtmlFooter); 162 out.push_back(kHtmlFooter);
163 163
164 std::string out_html = JoinString(out, ""); 164 std::string out_html = JoinString(out, "");
165 callback.Run(base::RefCountedString::TakeString(&out_html)); 165 callback.Run(base::RefCountedString::TakeString(&out_html));
166 } 166 }
OLDNEW
« no previous file with comments | « chrome/browser/search/instant_service.cc ('k') | chrome/browser/thumbnails/thumbnail_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698