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/app_list/search/launcher_search/launcher_search_icon
_image_loader.h" | 5 #include "chrome/browser/ui/app_list/search/launcher_search/launcher_search_icon
_image_loader.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chrome/browser/chromeos/launcher_search_provider/error_reporter.h" | 10 #include "chrome/browser/chromeos/launcher_search_provider/error_reporter.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 } // namespace | 24 } // namespace |
25 | 25 |
26 namespace app_list { | 26 namespace app_list { |
27 | 27 |
28 LauncherSearchIconImageLoader::LauncherSearchIconImageLoader( | 28 LauncherSearchIconImageLoader::LauncherSearchIconImageLoader( |
29 const GURL& icon_url, | 29 const GURL& icon_url, |
30 Profile* profile, | 30 Profile* profile, |
31 const extensions::Extension* extension, | 31 const extensions::Extension* extension, |
32 const int icon_dimension, | 32 const int icon_dimension, |
33 scoped_ptr<chromeos::launcher_search_provider::ErrorReporter> | 33 std::unique_ptr<chromeos::launcher_search_provider::ErrorReporter> |
34 error_reporter) | 34 error_reporter) |
35 : profile_(profile), | 35 : profile_(profile), |
36 extension_(extension), | 36 extension_(extension), |
37 icon_url_(icon_url), | 37 icon_url_(icon_url), |
38 icon_size_(icon_dimension, icon_dimension), | 38 icon_size_(icon_dimension, icon_dimension), |
39 error_reporter_(std::move(error_reporter)) {} | 39 error_reporter_(std::move(error_reporter)) {} |
40 | 40 |
41 LauncherSearchIconImageLoader::~LauncherSearchIconImageLoader() { | 41 LauncherSearchIconImageLoader::~LauncherSearchIconImageLoader() { |
42 } | 42 } |
43 | 43 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 if (icon_url_.spec().size() <= max_size) | 156 if (icon_url_.spec().size() <= max_size) |
157 return icon_url_.spec(); | 157 return icon_url_.spec(); |
158 | 158 |
159 std::string truncated_url; | 159 std::string truncated_url; |
160 base::TruncateUTF8ToByteSize(icon_url_.spec(), max_size - 3, &truncated_url); | 160 base::TruncateUTF8ToByteSize(icon_url_.spec(), max_size - 3, &truncated_url); |
161 truncated_url.append("..."); | 161 truncated_url.append("..."); |
162 return truncated_url; | 162 return truncated_url; |
163 } | 163 } |
164 | 164 |
165 } // namespace app_list | 165 } // namespace app_list |
OLD | NEW |