| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 item->title, UTF8ToWide(item->keyword), item->url); | 240 item->title, UTF8ToWide(item->keyword), item->url); |
| 241 if (t_url) | 241 if (t_url) |
| 242 template_urls.push_back(t_url); | 242 template_urls.push_back(t_url); |
| 243 } | 243 } |
| 244 | 244 |
| 245 STLDeleteContainerPointers(list.begin(), list.end()); | 245 STLDeleteContainerPointers(list.begin(), list.end()); |
| 246 | 246 |
| 247 // Write into profile. | 247 // Write into profile. |
| 248 if (!bookmarks.empty() && !cancelled()) { | 248 if (!bookmarks.empty() && !cancelled()) { |
| 249 main_loop_->PostTask(FROM_HERE, NewRunnableMethod(writer_, | 249 main_loop_->PostTask(FROM_HERE, NewRunnableMethod(writer_, |
| 250 &ProfileWriter::AddBookmarkEntry, bookmarks, false)); | 250 &ProfileWriter::AddBookmarkEntry, bookmarks, |
| 251 l10n_util::GetString(IDS_BOOKMARK_GROUP_FROM_FIREFOX), |
| 252 first_run() ? ProfileWriter::FIRST_RUN : 0)); |
| 251 } | 253 } |
| 252 if (!template_urls.empty() && !cancelled()) { | 254 if (!template_urls.empty() && !cancelled()) { |
| 253 main_loop_->PostTask(FROM_HERE, NewRunnableMethod(writer_, | 255 main_loop_->PostTask(FROM_HERE, NewRunnableMethod(writer_, |
| 254 &ProfileWriter::AddKeywords, template_urls, -1, false)); | 256 &ProfileWriter::AddKeywords, template_urls, -1, false)); |
| 255 } else { | 257 } else { |
| 256 STLDeleteContainerPointers(template_urls.begin(), template_urls.end()); | 258 STLDeleteContainerPointers(template_urls.begin(), template_urls.end()); |
| 257 } | 259 } |
| 258 if (!favicon_map.empty() && !cancelled()) { | 260 if (!favicon_map.empty() && !cancelled()) { |
| 259 std::vector<history::ImportedFavIconUsage> favicons; | 261 std::vector<history::ImportedFavIconUsage> favicons; |
| 260 LoadFavicons(db.get(), favicon_map, &favicons); | 262 LoadFavicons(db.get(), favicon_map, &favicons); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 | 497 |
| 496 if (!ReencodeFavicon(&data[0], data.size(), &usage.png_data)) | 498 if (!ReencodeFavicon(&data[0], data.size(), &usage.png_data)) |
| 497 continue; // Unable to decode. | 499 continue; // Unable to decode. |
| 498 | 500 |
| 499 usage.urls = i->second; | 501 usage.urls = i->second; |
| 500 favicons->push_back(usage); | 502 favicons->push_back(usage); |
| 501 } | 503 } |
| 502 s.reset(); | 504 s.reset(); |
| 503 } | 505 } |
| 504 } | 506 } |
| OLD | NEW |