| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/utility/importer/bookmark_html_reader.h" | 5 #include "chrome/utility/importer/bookmark_html_reader.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/i18n/icu_string_conversions.h" | 9 #include "base/i18n/icu_string_conversions.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 // Add date | 322 // Add date |
| 323 if (GetAttribute(attribute_list, kAddDateAttribute, &value)) { | 323 if (GetAttribute(attribute_list, kAddDateAttribute, &value)) { |
| 324 int64 time; | 324 int64 time; |
| 325 base::StringToInt64(value, &time); | 325 base::StringToInt64(value, &time); |
| 326 // Upper bound it at 32 bits. | 326 // Upper bound it at 32 bits. |
| 327 if (0 < time && time < (1LL << 32)) | 327 if (0 < time && time < (1LL << 32)) |
| 328 *add_date = base::Time::FromTimeT(time); | 328 *add_date = base::Time::FromTimeT(time); |
| 329 } | 329 } |
| 330 | 330 |
| 331 if (GetAttribute(attribute_list, kToolbarFolderAttribute, &value) && | 331 if (GetAttribute(attribute_list, kToolbarFolderAttribute, &value) && |
| 332 LowerCaseEqualsASCII(value, "true")) | 332 base::LowerCaseEqualsASCII(value, "true")) |
| 333 *is_toolbar_folder = true; | 333 *is_toolbar_folder = true; |
| 334 else | 334 else |
| 335 *is_toolbar_folder = false; | 335 *is_toolbar_folder = false; |
| 336 | 336 |
| 337 return true; | 337 return true; |
| 338 } | 338 } |
| 339 | 339 |
| 340 bool ParseBookmarkFromLine(const std::string& line, | 340 bool ParseBookmarkFromLine(const std::string& line, |
| 341 const std::string& charset, | 341 const std::string& charset, |
| 342 base::string16* title, | 342 base::string16* title, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 *url = GURL(value); | 469 *url = GURL(value); |
| 470 } | 470 } |
| 471 } | 471 } |
| 472 | 472 |
| 473 return true; | 473 return true; |
| 474 } | 474 } |
| 475 | 475 |
| 476 } // namespace internal | 476 } // namespace internal |
| 477 | 477 |
| 478 } // namespace bookmark_html_reader | 478 } // namespace bookmark_html_reader |
| OLD | NEW |