OLD | NEW |
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/search/suggestions/suggestions_source.h" | 5 #include "chrome/browser/search/suggestions/suggestions_source.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/barrier_closure.h" | 9 #include "base/barrier_closure.h" |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/search/suggestions/suggestions_service.h" | |
18 #include "chrome/browser/search/suggestions/suggestions_service_factory.h" | 17 #include "chrome/browser/search/suggestions/suggestions_service_factory.h" |
19 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
| 19 #include "components/suggestions/suggestions_service.h" |
20 #include "net/base/escape.h" | 20 #include "net/base/escape.h" |
21 #include "ui/gfx/codec/png_codec.h" | 21 #include "ui/gfx/codec/png_codec.h" |
22 #include "ui/gfx/image/image_skia.h" | 22 #include "ui/gfx/image/image_skia.h" |
23 #include "url/gurl.h" | 23 #include "url/gurl.h" |
24 | 24 |
25 namespace suggestions { | 25 namespace suggestions { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 const char kHtmlHeader[] = | 29 const char kHtmlHeader[] = |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 std::string encoded_output; | 174 std::string encoded_output; |
175 base::Base64Encode(std::string(output.begin(), output.end()), | 175 base::Base64Encode(std::string(output.begin(), output.end()), |
176 &encoded_output); | 176 &encoded_output); |
177 context->base64_encoded_pngs[url] = "data:image/png;base64,"; | 177 context->base64_encoded_pngs[url] = "data:image/png;base64,"; |
178 context->base64_encoded_pngs[url] += encoded_output; | 178 context->base64_encoded_pngs[url] += encoded_output; |
179 } | 179 } |
180 barrier.Run(); | 180 barrier.Run(); |
181 } | 181 } |
182 | 182 |
183 } // namespace suggestions | 183 } // namespace suggestions |
OLD | NEW |