| 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/file_util.h" | 8 #include "base/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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // Add date | 286 // Add date |
| 287 if (GetAttribute(attribute_list, kAddDateAttribute, &value)) { | 287 if (GetAttribute(attribute_list, kAddDateAttribute, &value)) { |
| 288 int64 time; | 288 int64 time; |
| 289 base::StringToInt64(value, &time); | 289 base::StringToInt64(value, &time); |
| 290 // Upper bound it at 32 bits. | 290 // Upper bound it at 32 bits. |
| 291 if (0 < time && time < (1LL << 32)) | 291 if (0 < time && time < (1LL << 32)) |
| 292 *add_date = base::Time::FromTimeT(time); | 292 *add_date = base::Time::FromTimeT(time); |
| 293 } | 293 } |
| 294 | 294 |
| 295 if (GetAttribute(attribute_list, kToolbarFolderAttribute, &value) && | 295 if (GetAttribute(attribute_list, kToolbarFolderAttribute, &value) && |
| 296 LowerCaseEqualsASCII(value, "true")) | 296 base::LowerCaseEqualsASCII(value, "true")) |
| 297 *is_toolbar_folder = true; | 297 *is_toolbar_folder = true; |
| 298 else | 298 else |
| 299 *is_toolbar_folder = false; | 299 *is_toolbar_folder = false; |
| 300 | 300 |
| 301 return true; | 301 return true; |
| 302 } | 302 } |
| 303 | 303 |
| 304 bool ParseBookmarkFromLine(const std::string& line, | 304 bool ParseBookmarkFromLine(const std::string& line, |
| 305 const std::string& charset, | 305 const std::string& charset, |
| 306 base::string16* title, | 306 base::string16* title, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 *url = GURL(value); | 433 *url = GURL(value); |
| 434 } | 434 } |
| 435 } | 435 } |
| 436 | 436 |
| 437 return true; | 437 return true; |
| 438 } | 438 } |
| 439 | 439 |
| 440 } // namespace internal | 440 } // namespace internal |
| 441 | 441 |
| 442 } // namespace bookmark_html_reader | 442 } // namespace bookmark_html_reader |
| OLD | NEW |