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

Side by Side Diff: chrome/browser/ui/webui/large_icon_source.cc

Issue 1032683002: [Icons NTP] Refactoring: Moving FallbackIconService to components\favicon\core (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Putting back +third_party/skia/include for favicon_base DEPS. Created 5 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/large_icon_source.h" 5 #include "chrome/browser/ui/webui/large_icon_source.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 LargeIconSource::LargeIconSource(Profile* profile) : profile_(profile) { 45 LargeIconSource::LargeIconSource(Profile* profile) : profile_(profile) {
46 std::vector<std::string> font_list; 46 std::vector<std::string> font_list;
47 #if defined(OS_CHROMEOS) 47 #if defined(OS_CHROMEOS)
48 font_list.push_back("Noto Sans"); 48 font_list.push_back("Noto Sans");
49 #elif defined(OS_IOS) 49 #elif defined(OS_IOS)
50 font_list.push_back("Helvetica Neue"); 50 font_list.push_back("Helvetica Neue");
51 #else 51 #else
52 font_list.push_back(l10n_util::GetStringUTF8(IDS_SANS_SERIF_FONT_FAMILY)); 52 font_list.push_back(l10n_util::GetStringUTF8(IDS_SANS_SERIF_FONT_FAMILY));
53 #endif 53 #endif
54 fallback_icon_service_.reset( 54 fallback_icon_service_.reset(new FallbackIconService(font_list));
55 new favicon_base::FallbackIconService(font_list));
56 } 55 }
57 56
58 LargeIconSource::~LargeIconSource() { 57 LargeIconSource::~LargeIconSource() {
59 } 58 }
60 59
61 std::string LargeIconSource::GetSource() const { 60 std::string LargeIconSource::GetSource() const {
62 return chrome::kChromeUILargeIconHost; 61 return chrome::kChromeUILargeIconHost;
63 } 62 }
64 63
65 void LargeIconSource::StartDataRequest( 64 void LargeIconSource::StartDataRequest(
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 std::vector<unsigned char> bitmap_data = 134 std::vector<unsigned char> bitmap_data =
136 fallback_icon_service_->RenderFallbackIconBitmap( 135 fallback_icon_service_->RenderFallbackIconBitmap(
137 request.url, request.size, style); 136 request.url, request.size, style);
138 request.callback.Run(base::RefCountedBytes::TakeVector(&bitmap_data)); 137 request.callback.Run(base::RefCountedBytes::TakeVector(&bitmap_data));
139 } 138 }
140 139
141 void LargeIconSource::SendNotFoundResponse( 140 void LargeIconSource::SendNotFoundResponse(
142 const content::URLDataSource::GotDataCallback& callback) { 141 const content::URLDataSource::GotDataCallback& callback) {
143 callback.Run(nullptr); 142 callback.Run(nullptr);
144 } 143 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698