OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 using importer::BOOKMARKS_HTML; | 29 using importer::BOOKMARKS_HTML; |
30 using importer::FAVORITES; | 30 using importer::FAVORITES; |
31 using importer::HISTORY; | 31 using importer::HISTORY; |
32 using importer::HOME_PAGE; | 32 using importer::HOME_PAGE; |
33 using importer::PASSWORDS; | 33 using importer::PASSWORDS; |
34 using importer::ProfileInfo; | 34 using importer::ProfileInfo; |
35 using importer::SEARCH_ENGINES; | 35 using importer::SEARCH_ENGINES; |
36 using webkit_glue::PasswordForm; | 36 using webkit_glue::PasswordForm; |
37 | 37 |
38 Firefox3Importer::Firefox3Importer() { | 38 Firefox3Importer::Firefox3Importer() { |
| 39 #if defined(OS_LINUX) |
39 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 40 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); |
40 | |
41 locale_ = g_browser_process->GetApplicationLocale(); | 41 locale_ = g_browser_process->GetApplicationLocale(); |
| 42 #endif |
42 } | 43 } |
43 | 44 |
44 Firefox3Importer::~Firefox3Importer() { | 45 Firefox3Importer::~Firefox3Importer() { |
45 } | 46 } |
46 | 47 |
47 void Firefox3Importer::StartImport(importer::ProfileInfo profile_info, | 48 void Firefox3Importer::StartImport(importer::ProfileInfo profile_info, |
48 uint16 items, | 49 uint16 items, |
49 ImporterBridge* bridge) { | 50 ImporterBridge* bridge) { |
| 51 #if defined(OS_LINUX) |
50 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); | 52 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); |
| 53 #endif |
51 bridge_ = bridge; | 54 bridge_ = bridge; |
52 source_path_ = profile_info.source_path; | 55 source_path_ = profile_info.source_path; |
53 app_path_ = profile_info.app_path; | 56 app_path_ = profile_info.app_path; |
54 | 57 |
55 // The order here is important! | 58 // The order here is important! |
56 bridge_->NotifyStarted(); | 59 bridge_->NotifyStarted(); |
57 if ((items & importer::HOME_PAGE) && !cancelled()) | 60 if ((items & importer::HOME_PAGE) && !cancelled()) |
58 ImportHomepage(); // Doesn't have a UI item. | 61 ImportHomepage(); // Doesn't have a UI item. |
59 | 62 |
60 // Note history should be imported before bookmarks because bookmark import | 63 // Note history should be imported before bookmarks because bookmark import |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 | 551 |
549 if (!ReencodeFavicon(&data[0], data.size(), &usage.png_data)) | 552 if (!ReencodeFavicon(&data[0], data.size(), &usage.png_data)) |
550 continue; // Unable to decode. | 553 continue; // Unable to decode. |
551 | 554 |
552 usage.urls = i->second; | 555 usage.urls = i->second; |
553 favicons->push_back(usage); | 556 favicons->push_back(usage); |
554 } | 557 } |
555 s.reset(); | 558 s.reset(); |
556 } | 559 } |
557 } | 560 } |
OLD | NEW |