OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 "WHERE aa.name = 'bookmarkProperties/POSTData'"; | 198 "WHERE aa.name = 'bookmarkProperties/POSTData'"; |
199 sql::Statement s(db.GetUniqueStatement(query)); | 199 sql::Statement s(db.GetUniqueStatement(query)); |
200 if (s) { | 200 if (s) { |
201 while (s.Step() && !cancelled()) | 201 while (s.Step() && !cancelled()) |
202 post_keyword_ids.insert(s.ColumnInt(0)); | 202 post_keyword_ids.insert(s.ColumnInt(0)); |
203 } else { | 203 } else { |
204 NOTREACHED(); | 204 NOTREACHED(); |
205 return; | 205 return; |
206 } | 206 } |
207 | 207 |
208 string16 firefox_folder = | |
209 bridge_->GetLocalizedString(IDS_BOOKMARK_GROUP_FROM_FIREFOX); | |
210 for (size_t i = 0; i < list.size(); ++i) { | 208 for (size_t i = 0; i < list.size(); ++i) { |
211 BookmarkItem* item = list[i]; | 209 BookmarkItem* item = list[i]; |
212 | 210 |
213 if (item->type == TYPE_FOLDER) { | 211 if (item->type == TYPE_FOLDER) { |
214 // Folders are added implicitly on adding children, so we only explicitly | 212 // Folders are added implicitly on adding children, so we only explicitly |
215 // add empty folders. | 213 // add empty folders. |
216 if (!item->empty_folder) | 214 if (!item->empty_folder) |
217 continue; | 215 continue; |
218 } else if (item->type == TYPE_BOOKMARK) { | 216 } else if (item->type == TYPE_BOOKMARK) { |
219 // Import only valid bookmarks | 217 // Import only valid bookmarks |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 | 572 |
575 if (!importer::ReencodeFavicon(&data[0], data.size(), &usage.png_data)) | 573 if (!importer::ReencodeFavicon(&data[0], data.size(), &usage.png_data)) |
576 continue; // Unable to decode. | 574 continue; // Unable to decode. |
577 | 575 |
578 usage.urls = i->second; | 576 usage.urls = i->second; |
579 favicons->push_back(usage); | 577 favicons->push_back(usage); |
580 } | 578 } |
581 s.Reset(); | 579 s.Reset(); |
582 } | 580 } |
583 } | 581 } |
OLD | NEW |