Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: chrome/utility/importer/firefox_importer.cc

Issue 2349643002: Fix failed to import bookmarks from firefox (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/firefox_importer.h" 5 #include "chrome/utility/importer/firefox_importer.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 9
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 search_engine_data->push_back(file_data); 644 search_engine_data->push_back(file_data);
645 } 645 }
646 } 646 }
647 } 647 }
648 } 648 }
649 649
650 void FirefoxImporter::LoadRootNodeID(sql::Connection* db, 650 void FirefoxImporter::LoadRootNodeID(sql::Connection* db,
651 int* toolbar_folder_id, 651 int* toolbar_folder_id,
652 int* menu_folder_id, 652 int* menu_folder_id,
653 int* unsorted_folder_id) { 653 int* unsorted_folder_id) {
654 static const char kToolbarFolderName[] = "toolbar"; 654 static const char kToolbarFolderName[] = "Bookmarks Toolbar";
655 static const char kMenuFolderName[] = "menu"; 655 static const char kMenuFolderName[] = "Bookmarks Menu";
656 static const char kUnsortedFolderName[] = "unfiled"; 656 static const char kUnsortedFolderName[] = "Other Bookmarks";
657 657
658 const char query[] = "SELECT root_name, folder_id FROM moz_bookmarks_roots"; 658 const char query[] = "SELECT b.title, b.id FROM moz_bookmarks b "
659 "WHERE b.type = 2";
659 sql::Statement s(db->GetUniqueStatement(query)); 660 sql::Statement s(db->GetUniqueStatement(query));
660 661
661 while (s.Step()) { 662 while (s.Step()) {
662 std::string folder = s.ColumnString(0); 663 std::string folder = s.ColumnString(0);
663 int id = s.ColumnInt(1); 664 int id = s.ColumnInt(1);
664 if (folder == kToolbarFolderName) 665 if (folder == kToolbarFolderName)
665 *toolbar_folder_id = id; 666 *toolbar_folder_id = id;
666 else if (folder == kMenuFolderName) 667 else if (folder == kMenuFolderName)
667 *menu_folder_id = id; 668 *menu_folder_id = id;
668 else if (folder == kUnsortedFolderName) 669 else if (folder == kUnsortedFolderName)
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 786
786 if (!importer::ReencodeFavicon(&data[0], data.size(), &usage.png_data)) 787 if (!importer::ReencodeFavicon(&data[0], data.size(), &usage.png_data))
787 continue; // Unable to decode. 788 continue; // Unable to decode.
788 789
789 usage.urls = i->second; 790 usage.urls = i->second;
790 favicons->push_back(usage); 791 favicons->push_back(usage);
791 } 792 }
792 s.Reset(true); 793 s.Reset(true);
793 } 794 }
794 } 795 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698