summaryrefslogtreecommitdiffstats
path: root/chrome/browser/importer
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 23:36:12 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 23:36:12 +0000
commit2c1427f1a879f97711ac50beede79ba1b1f4a933 (patch)
tree2d84110261d1200c8432487ca40160134d6cea37 /chrome/browser/importer
parent6b675b8ccc7b6d9fd04265706aa30cb9c56899d7 (diff)
downloadchromium_src-2c1427f1a879f97711ac50beede79ba1b1f4a933.zip
chromium_src-2c1427f1a879f97711ac50beede79ba1b1f4a933.tar.gz
chromium_src-2c1427f1a879f97711ac50beede79ba1b1f4a933.tar.bz2
Make importer.cc compile on Posix.
Review URL: http://codereview.chromium.org/27242 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10528 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/importer')
-rw-r--r--chrome/browser/importer/importer.cc32
-rw-r--r--chrome/browser/importer/importer.h6
2 files changed, 32 insertions, 6 deletions
diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc
index 88923ca..6a2e59f 100644
--- a/chrome/browser/importer/importer.cc
+++ b/chrome/browser/importer/importer.cc
@@ -20,23 +20,29 @@
#include "chrome/browser/importer/firefox3_importer.h"
#include "chrome/browser/importer/firefox_importer_utils.h"
#include "chrome/browser/importer/firefox_profile_lock.h"
+#if defined(OS_WIN)
#include "chrome/browser/importer/ie_importer.h"
+#endif
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/tab_contents/site_instance.h"
-#include "chrome/browser/views/importer_lock_view.h"
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/common/gfx/favicon_size.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
-#include "chrome/common/win_util.h"
-#include "chrome/views/window.h"
#include "grit/generated_resources.h"
#include "skia/ext/image_operations.h"
#include "webkit/glue/image_decoder.h"
+// TODO(port): Port these files.
+#if defined(OS_WIN)
+#include "chrome/browser/views/importer_lock_view.h"
+#include "chrome/common/win_util.h"
+#include "chrome/views/window.h"
+#endif
+
// ProfileWriter.
bool ProfileWriter::BookmarkModelIsLoaded() const {
@@ -64,9 +70,11 @@ void ProfileWriter::AddPasswordForm(const PasswordForm& form) {
profile_->GetWebDataService(Profile::EXPLICIT_ACCESS)->AddLogin(form);
}
+#if defined(OS_WIN)
void ProfileWriter::AddIE7PasswordInfo(const IE7PasswordInfo& info) {
profile_->GetWebDataService(Profile::EXPLICIT_ACCESS)->AddIE7Login(info);
}
+#endif
void ProfileWriter::AddHistoryPage(const std::vector<history::URLRow>& page) {
profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)->
@@ -270,7 +278,7 @@ void ProfileWriter::AddKeywords(const std::vector<TemplateURL*>& template_urls,
}
if (t_url->url() && t_url->url()->IsValid()) {
model->Add(t_url);
- if (default_keyword && t_url->url() &&
+ if (default_keyword && t_url->url() &&
t_url->url()->SupportsReplacement())
model->SetDefaultSearchProvider(t_url);
} else {
@@ -330,7 +338,7 @@ bool ProfileWriter::DoesBookmarkExist(
model->GetNodesByURL(entry.url, &nodes_with_same_url);
if (nodes_with_same_url.empty())
return false;
-
+
for (size_t i = 0; i < nodes_with_same_url.size(); ++i) {
BookmarkNode* node = nodes_with_same_url[i];
if (entry.title != node->GetTitle())
@@ -448,8 +456,13 @@ void ImporterHost::ShowWarningDialog() {
if (headless_) {
OnLockViewEnd(false);
} else {
+#if defined(OS_WIN)
views::Window::CreateChromeWindow(GetActiveWindow(), gfx::Rect(),
new ImporterLockView(this))->Show();
+#else
+ // TODO(port): Need CreateChromeWindow.
+ NOTIMPLEMENTED();
+#endif
}
}
@@ -562,8 +575,10 @@ void ImporterHost::ImportEnded() {
Importer* ImporterHost::CreateImporterByType(ProfileType type) {
switch (type) {
+#if defined(OS_WIN)
case MS_IE:
return new IEImporter();
+#endif
case BOOKMARKS_HTML:
case FIREFOX2:
return new Firefox2Importer();
@@ -589,6 +604,7 @@ const ProfileInfo& ImporterHost::GetSourceProfileInfoAt(int index) const {
}
void ImporterHost::DetectSourceProfiles() {
+#if defined(OS_WIN)
// The order in which detect is called determines the order
// in which the options appear in the dropdown combo-box
if (ShellIntegration::IsFirefoxDefaultBrowser()) {
@@ -598,8 +614,13 @@ void ImporterHost::DetectSourceProfiles() {
DetectIEProfiles();
DetectFirefoxProfiles();
}
+#else
+ DetectFirefoxProfiles();
+#endif
}
+
+#if defined(OS_WIN)
void ImporterHost::DetectIEProfiles() {
// IE always exists and don't have multiple profiles.
ProfileInfo* ie = new ProfileInfo();
@@ -611,6 +632,7 @@ void ImporterHost::DetectIEProfiles() {
SEARCH_ENGINES;
source_profiles_.push_back(ie);
}
+#endif
void ImporterHost::DetectFirefoxProfiles() {
// Detects which version of Firefox is installed.
diff --git a/chrome/browser/importer/importer.h b/chrome/browser/importer/importer.h
index ee5ac37..bdda367 100644
--- a/chrome/browser/importer/importer.h
+++ b/chrome/browser/importer/importer.h
@@ -27,7 +27,9 @@
// An enumeration of the type of browsers that we support to import
// settings and data from them.
enum ProfileType {
- MS_IE = 0,
+#if defined(OS_WIN)
+ MS_IE,
+#endif
FIREFOX2,
FIREFOX3,
// Identifies a 'bookmarks.html' file.
@@ -276,7 +278,9 @@ class ImporterHost : public base::RefCounted<ImporterHost>,
void DetectSourceProfiles();
// Helper methods for detecting available profiles.
+#if defined(OS_WIN)
void DetectIEProfiles();
+#endif
void DetectFirefoxProfiles();
// The list of profiles with the default one first.