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/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/history/history_types.h" | 17 #include "chrome/browser/history/history_types.h" |
17 #include "chrome/browser/importer/firefox2_importer.h" | 18 #include "chrome/browser/importer/firefox2_importer.h" |
18 #include "chrome/browser/importer/firefox_importer_utils.h" | 19 #include "chrome/browser/importer/firefox_importer_utils.h" |
19 #include "chrome/browser/importer/importer_bridge.h" | 20 #include "chrome/browser/importer/importer_bridge.h" |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 // Firefox. | 413 // Firefox. |
413 base::FilePath locale_app_path = app_path.AppendASCII(locale_); | 414 base::FilePath locale_app_path = app_path.AppendASCII(locale_); |
414 base::FilePath default_locale_app_path = app_path.AppendASCII("en-US"); | 415 base::FilePath default_locale_app_path = app_path.AppendASCII("en-US"); |
415 if (file_util::DirectoryExists(locale_app_path)) | 416 if (file_util::DirectoryExists(locale_app_path)) |
416 app_path = locale_app_path; | 417 app_path = locale_app_path; |
417 else if (file_util::DirectoryExists(default_locale_app_path)) | 418 else if (file_util::DirectoryExists(default_locale_app_path)) |
418 app_path = default_locale_app_path; | 419 app_path = default_locale_app_path; |
419 #endif | 420 #endif |
420 | 421 |
421 // Get search engine definition from file system. | 422 // Get search engine definition from file system. |
422 file_util::FileEnumerator engines(app_path, false, | 423 base::FileEnumerator engines(app_path, false, base::FileEnumerator::FILES); |
423 file_util::FileEnumerator::FILES); | |
424 for (base::FilePath engine_path = engines.Next(); | 424 for (base::FilePath engine_path = engines.Next(); |
425 !engine_path.value().empty(); engine_path = engines.Next()) { | 425 !engine_path.value().empty(); engine_path = engines.Next()) { |
426 files->push_back(engine_path); | 426 files->push_back(engine_path); |
427 } | 427 } |
428 } | 428 } |
429 | 429 |
430 void Firefox3Importer::LoadRootNodeID(sql::Connection* db, | 430 void Firefox3Importer::LoadRootNodeID(sql::Connection* db, |
431 int* toolbar_folder_id, | 431 int* toolbar_folder_id, |
432 int* menu_folder_id, | 432 int* menu_folder_id, |
433 int* unsorted_folder_id) { | 433 int* unsorted_folder_id) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 | 562 |
563 if (!importer::ReencodeFavicon(&data[0], data.size(), &usage.png_data)) | 563 if (!importer::ReencodeFavicon(&data[0], data.size(), &usage.png_data)) |
564 continue; // Unable to decode. | 564 continue; // Unable to decode. |
565 | 565 |
566 usage.urls = i->second; | 566 usage.urls = i->second; |
567 favicons->push_back(usage); | 567 favicons->push_back(usage); |
568 } | 568 } |
569 s.Reset(true); | 569 s.Reset(true); |
570 } | 570 } |
571 } | 571 } |
OLD | NEW |