| 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" |
| 11 #include "chrome/browser/favicon/favicon_service_factory.h" | 11 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/search/instant_io_context.h" | 13 #include "chrome/browser/search/instant_io_context.h" |
| 14 #include "chrome/common/favicon/large_icon_url_parser.h" | 14 #include "chrome/common/favicon/large_icon_url_parser.h" |
| 15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
| 16 #include "components/favicon/core/browser/favicon_service.h" | 16 #include "components/favicon/core/favicon_service.h" |
| 17 #include "components/favicon_base/fallback_icon_style.h" | 17 #include "components/favicon_base/fallback_icon_style.h" |
| 18 #include "grit/platform_locale_settings.h" | 18 #include "grit/platform_locale_settings.h" |
| 19 #include "net/url_request/url_request.h" | 19 #include "net/url_request/url_request.h" |
| 20 #include "third_party/skia/include/core/SkColor.h" | 20 #include "third_party/skia/include/core/SkColor.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 int kDefaultLargeIconSize = 96; | 25 int kDefaultLargeIconSize = 96; |
| 26 int kMaxLargeIconSize = 192; // Arbitrary bound to safeguard endpoint. | 26 int kMaxLargeIconSize = 192; // Arbitrary bound to safeguard endpoint. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 std::vector<unsigned char> bitmap_data = | 135 std::vector<unsigned char> bitmap_data = |
| 136 fallback_icon_service_->RenderFallbackIconBitmap( | 136 fallback_icon_service_->RenderFallbackIconBitmap( |
| 137 request.url, request.size, style); | 137 request.url, request.size, style); |
| 138 request.callback.Run(base::RefCountedBytes::TakeVector(&bitmap_data)); | 138 request.callback.Run(base::RefCountedBytes::TakeVector(&bitmap_data)); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void LargeIconSource::SendNotFoundResponse( | 141 void LargeIconSource::SendNotFoundResponse( |
| 142 const content::URLDataSource::GotDataCallback& callback) { | 142 const content::URLDataSource::GotDataCallback& callback) { |
| 143 callback.Run(nullptr); | 143 callback.Run(nullptr); |
| 144 } | 144 } |
| OLD | NEW |