 Chromium Code Reviews
 Chromium Code Reviews Issue 160341:
  First cut at Firefox import on OSX + stubs for Safari import.  (Closed)
    
  
    Issue 160341:
  First cut at Firefox import on OSX + stubs for Safari import.  (Closed) 
  | 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/importer.h" | 5 #include "chrome/browser/importer/importer.h" | 
| 6 | 6 | 
| 7 #include <map> | 7 #include <map> | 
| 8 #include <set> | 8 #include <set> | 
| 9 | 9 | 
| 10 #include "app/gfx/favicon_size.h" | 10 #include "app/gfx/favicon_size.h" | 
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 643 case MS_IE: | 643 case MS_IE: | 
| 644 return new IEImporter(); | 644 return new IEImporter(); | 
| 645 #endif | 645 #endif | 
| 646 case BOOKMARKS_HTML: | 646 case BOOKMARKS_HTML: | 
| 647 case FIREFOX2: | 647 case FIREFOX2: | 
| 648 return new Firefox2Importer(); | 648 return new Firefox2Importer(); | 
| 649 case FIREFOX3: | 649 case FIREFOX3: | 
| 650 return new Firefox3Importer(); | 650 return new Firefox3Importer(); | 
| 651 case GOOGLE_TOOLBAR5: | 651 case GOOGLE_TOOLBAR5: | 
| 652 return new Toolbar5Importer(); | 652 return new Toolbar5Importer(); | 
| 653 case SAFARI: | |
| 
stuartmorgan
2009/07/29 20:22:37
Should this have platform ifdef-ing, since MS_IE h
 | |
| 654 // TODO(jeremy): Implement. | |
| 655 NOTIMPLEMENTED(); | |
| 656 return NULL; | |
| 653 } | 657 } | 
| 654 NOTREACHED(); | 658 NOTREACHED(); | 
| 655 return NULL; | 659 return NULL; | 
| 656 } | 660 } | 
| 657 | 661 | 
| 658 int ImporterHost::GetAvailableProfileCount() { | 662 int ImporterHost::GetAvailableProfileCount() { | 
| 659 return static_cast<int>(source_profiles_.size()); | 663 return static_cast<int>(source_profiles_.size()); | 
| 660 } | 664 } | 
| 661 | 665 | 
| 662 std::wstring ImporterHost::GetSourceProfileNameAt(int index) const { | 666 std::wstring ImporterHost::GetSourceProfileNameAt(int index) const { | 
| (...skipping 24 matching lines...) Expand all Loading... | |
| 687 if (ShellIntegration::IsFirefoxDefaultBrowser()) { | 691 if (ShellIntegration::IsFirefoxDefaultBrowser()) { | 
| 688 DetectFirefoxProfiles(); | 692 DetectFirefoxProfiles(); | 
| 689 DetectIEProfiles(); | 693 DetectIEProfiles(); | 
| 690 } else { | 694 } else { | 
| 691 DetectIEProfiles(); | 695 DetectIEProfiles(); | 
| 692 DetectFirefoxProfiles(); | 696 DetectFirefoxProfiles(); | 
| 693 } | 697 } | 
| 694 // TODO(brg) : Current UI requires win_util. | 698 // TODO(brg) : Current UI requires win_util. | 
| 695 DetectGoogleToolbarProfiles(); | 699 DetectGoogleToolbarProfiles(); | 
| 696 #else | 700 #else | 
| 701 #if defined(OS_MACOSX) | |
| 702 DetectSafariProfiles(); | |
| 703 #endif | |
| 697 DetectFirefoxProfiles(); | 704 DetectFirefoxProfiles(); | 
| 698 #endif | 705 #endif | 
| 699 } | 706 } | 
| 700 | 707 | 
| 701 | 708 | 
| 702 #if defined(OS_WIN) | 709 #if defined(OS_WIN) | 
| 703 void ImporterHost::DetectIEProfiles() { | 710 void ImporterHost::DetectIEProfiles() { | 
| 704 // IE always exists and don't have multiple profiles. | 711 // IE always exists and don't have multiple profiles. | 
| 705 ProfileInfo* ie = new ProfileInfo(); | 712 ProfileInfo* ie = new ProfileInfo(); | 
| 706 ie->description = l10n_util::GetString(IDS_IMPORT_FROM_IE); | 713 ie->description = l10n_util::GetString(IDS_IMPORT_FROM_IE); | 
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 800 ProfileInfo* google_toolbar = new ProfileInfo(); | 807 ProfileInfo* google_toolbar = new ProfileInfo(); | 
| 801 google_toolbar->browser_type = GOOGLE_TOOLBAR5; | 808 google_toolbar->browser_type = GOOGLE_TOOLBAR5; | 
| 802 google_toolbar->description = l10n_util::GetString( | 809 google_toolbar->description = l10n_util::GetString( | 
| 803 IDS_IMPORT_FROM_GOOGLE_TOOLBAR); | 810 IDS_IMPORT_FROM_GOOGLE_TOOLBAR); | 
| 804 google_toolbar->source_path.clear(); | 811 google_toolbar->source_path.clear(); | 
| 805 google_toolbar->app_path.clear(); | 812 google_toolbar->app_path.clear(); | 
| 806 google_toolbar->services_supported = FAVORITES; | 813 google_toolbar->services_supported = FAVORITES; | 
| 807 source_profiles_.push_back(google_toolbar); | 814 source_profiles_.push_back(google_toolbar); | 
| 808 } | 815 } | 
| 809 } | 816 } | 
| 817 | |
| 818 #if defined(OS_MACOSX) | |
| 819 void ImporterHost::DetectSafariProfiles() { | |
| 820 // TODO(jeremy):Check that Safari folder is in fact present. | |
| 821 ProfileInfo* safari = new ProfileInfo(); | |
| 822 safari->browser_type = SAFARI; | |
| 823 safari->description = l10n_util::GetString(IDS_IMPORT_FROM_SAFARI); | |
| 824 safari->source_path.clear(); | |
| 825 safari->app_path.clear(); | |
| 826 safari->services_supported = HISTORY | FAVORITES | COOKIES | PASSWORDS | | |
| 827 SEARCH_ENGINES; | |
| 828 source_profiles_.push_back(safari); | |
| 829 } | |
| 830 #endif // OS_MACOSX | |
| OLD | NEW |