| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/importer/firefox3_importer.h" | 5 #include "chrome/browser/importer/firefox3_importer.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_enumerator.h" |
| 10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 12 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 14 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/browser/bookmarks/bookmark_html_reader.h" | 16 #include "chrome/browser/bookmarks/bookmark_html_reader.h" |
| 16 #include "chrome/browser/bookmarks/imported_bookmark_entry.h" | 17 #include "chrome/browser/bookmarks/imported_bookmark_entry.h" |
| 17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/favicon/favicon_util.h" | 19 #include "chrome/browser/favicon/favicon_util.h" |
| 19 #include "chrome/browser/favicon/imported_favicon_usage.h" | 20 #include "chrome/browser/favicon/imported_favicon_usage.h" |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 // Firefox. | 447 // Firefox. |
| 447 base::FilePath locale_app_path = app_path.AppendASCII(locale_); | 448 base::FilePath locale_app_path = app_path.AppendASCII(locale_); |
| 448 base::FilePath default_locale_app_path = app_path.AppendASCII("en-US"); | 449 base::FilePath default_locale_app_path = app_path.AppendASCII("en-US"); |
| 449 if (file_util::DirectoryExists(locale_app_path)) | 450 if (file_util::DirectoryExists(locale_app_path)) |
| 450 app_path = locale_app_path; | 451 app_path = locale_app_path; |
| 451 else if (file_util::DirectoryExists(default_locale_app_path)) | 452 else if (file_util::DirectoryExists(default_locale_app_path)) |
| 452 app_path = default_locale_app_path; | 453 app_path = default_locale_app_path; |
| 453 #endif | 454 #endif |
| 454 | 455 |
| 455 // Get search engine definition from file system. | 456 // Get search engine definition from file system. |
| 456 file_util::FileEnumerator engines(app_path, false, | 457 base::FileEnumerator engines(app_path, false, base::FileEnumerator::FILES); |
| 457 file_util::FileEnumerator::FILES); | |
| 458 for (base::FilePath engine_path = engines.Next(); | 458 for (base::FilePath engine_path = engines.Next(); |
| 459 !engine_path.value().empty(); engine_path = engines.Next()) { | 459 !engine_path.value().empty(); engine_path = engines.Next()) { |
| 460 files->push_back(engine_path); | 460 files->push_back(engine_path); |
| 461 } | 461 } |
| 462 } | 462 } |
| 463 | 463 |
| 464 void Firefox3Importer::LoadRootNodeID(sql::Connection* db, | 464 void Firefox3Importer::LoadRootNodeID(sql::Connection* db, |
| 465 int* toolbar_folder_id, | 465 int* toolbar_folder_id, |
| 466 int* menu_folder_id, | 466 int* menu_folder_id, |
| 467 int* unsorted_folder_id) { | 467 int* unsorted_folder_id) { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 | 596 |
| 597 if (!FaviconUtil::ReencodeFavicon(&data[0], data.size(), &usage.png_data)) | 597 if (!FaviconUtil::ReencodeFavicon(&data[0], data.size(), &usage.png_data)) |
| 598 continue; // Unable to decode. | 598 continue; // Unable to decode. |
| 599 | 599 |
| 600 usage.urls = i->second; | 600 usage.urls = i->second; |
| 601 favicons->push_back(usage); | 601 favicons->push_back(usage); |
| 602 } | 602 } |
| 603 s.Reset(true); | 603 s.Reset(true); |
| 604 } | 604 } |
| 605 } | 605 } |
| OLD | NEW |