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

Side by Side Diff: chrome/browser/ui/webui/ntp/thumbnail_list_source.cc

Issue 53283004: Adding support for forced URLs to TopSites. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed GetAllMostVisited. Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/ntp/most_visited_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/webui/ntp/thumbnail_list_source.h" 5 #include "chrome/browser/ui/webui/ntp/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"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 void ThumbnailListSource::StartDataRequest( 84 void ThumbnailListSource::StartDataRequest(
85 const std::string& path, 85 const std::string& path,
86 int render_process_id, 86 int render_process_id,
87 int render_view_id, 87 int render_view_id,
88 const content::URLDataSource::GotDataCallback& callback) { 88 const content::URLDataSource::GotDataCallback& callback) {
89 profile_->GetTopSites()->GetMostVisitedURLs( 89 profile_->GetTopSites()->GetMostVisitedURLs(
90 base::Bind(&ThumbnailListSource::OnMostVisitedURLsAvailable, 90 base::Bind(&ThumbnailListSource::OnMostVisitedURLsAvailable,
91 weak_ptr_factory_.GetWeakPtr(), 91 weak_ptr_factory_.GetWeakPtr(),
92 callback)); 92 callback), false);
93 } 93 }
94 94
95 std::string ThumbnailListSource::GetMimeType(const std::string& path) const { 95 std::string ThumbnailListSource::GetMimeType(const std::string& path) const {
96 return "text/html"; 96 return "text/html";
97 } 97 }
98 98
99 base::MessageLoop* ThumbnailListSource::MessageLoopForRequestPath( 99 base::MessageLoop* ThumbnailListSource::MessageLoopForRequestPath(
100 const std::string& path) const { 100 const std::string& path) const {
101 // TopSites can be accessed from the IO thread. 101 // TopSites can be accessed from the IO thread.
102 return thumbnail_service_.get() ? 102 return thumbnail_service_.get() ?
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 if (num_mv_with_thumb < num_mv) { 140 if (num_mv_with_thumb < num_mv) {
141 out.push_back("<h2>TopSites URLs without Thumbnails</h2>\n"); 141 out.push_back("<h2>TopSites URLs without Thumbnails</h2>\n");
142 RenderMostVisitedURLList(mvurl_list, base64_encoded_pngs, false, &out); 142 RenderMostVisitedURLList(mvurl_list, base64_encoded_pngs, false, &out);
143 } 143 }
144 out.push_back(html_footer); 144 out.push_back(html_footer);
145 145
146 std::string out_html = JoinString(out, ""); 146 std::string out_html = JoinString(out, "");
147 callback.Run(base::RefCountedString::TakeString(&out_html)); 147 callback.Run(base::RefCountedString::TakeString(&out_html));
148 } 148 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/most_visited_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698