OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |