OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/net/url_info.h" | 5 #include "chrome/browser/net/url_info.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 int print_hours = minutes/60; | 252 int print_hours = minutes/60; |
253 if (print_hours) | 253 if (print_hours) |
254 base::StringAppendF(&result, "%.2d:", print_hours); | 254 base::StringAppendF(&result, "%.2d:", print_hours); |
255 if (print_hours || print_minutes) | 255 if (print_hours || print_minutes) |
256 base::StringAppendF(&result, "%2.2d:", print_minutes); | 256 base::StringAppendF(&result, "%2.2d:", print_minutes); |
257 base::StringAppendF(&result, "%2.2d", print_seconds); | 257 base::StringAppendF(&result, "%2.2d", print_seconds); |
258 return result; | 258 return result; |
259 } | 259 } |
260 | 260 |
261 // static | 261 // static |
262 void UrlInfo::GetHtmlTable(const UrlInfoTable host_infos, | 262 void UrlInfo::GetHtmlTable(const UrlInfoTable& host_infos, |
263 const char* description, | 263 const char* description, |
264 const bool brief, | 264 bool brief, |
265 std::string* output) { | 265 std::string* output) { |
266 if (0 == host_infos.size()) | 266 if (0 == host_infos.size()) |
267 return; | 267 return; |
268 output->append(description); | 268 output->append(description); |
269 base::StringAppendF(output, "%" PRIuS " %s", host_infos.size(), | 269 base::StringAppendF(output, "%" PRIuS " %s", host_infos.size(), |
270 (1 == host_infos.size()) ? "hostname" : "hostnames"); | 270 (1 == host_infos.size()) ? "hostname" : "hostnames"); |
271 | 271 |
272 if (brief) { | 272 if (brief) { |
273 output->append("<br><br>"); | 273 output->append("<br><br>"); |
274 return; | 274 return; |
275 } | 275 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 339 |
340 case LEARNED_REFERAL_MOTIVATED: | 340 case LEARNED_REFERAL_MOTIVATED: |
341 return RemoveJs(referring_url_.spec()); | 341 return RemoveJs(referring_url_.spec()); |
342 | 342 |
343 default: | 343 default: |
344 return ""; | 344 return ""; |
345 } | 345 } |
346 } | 346 } |
347 | 347 |
348 } // namespace chrome_browser_net | 348 } // namespace chrome_browser_net |
OLD | NEW |