diff options
Diffstat (limited to 'chrome/browser/importer')
-rw-r--r-- | chrome/browser/importer/firefox2_importer.cc | 3 | ||||
-rw-r--r-- | chrome/browser/importer/firefox3_importer.cc | 5 | ||||
-rw-r--r-- | chrome/browser/importer/firefox3_importer.h | 3 | ||||
-rw-r--r-- | chrome/browser/importer/firefox_importer_utils.cc | 3 | ||||
-rw-r--r-- | chrome/browser/importer/firefox_importer_utils.h | 11 | ||||
-rw-r--r-- | chrome/browser/importer/firefox_importer_utils_linux.cc | 2 | ||||
-rw-r--r-- | chrome/browser/importer/firefox_importer_utils_mac.cc | 1 | ||||
-rw-r--r-- | chrome/browser/importer/firefox_importer_utils_win.cc | 1 | ||||
-rw-r--r-- | chrome/browser/importer/ie_importer.cc | 1 | ||||
-rw-r--r-- | chrome/browser/importer/importer.cc | 33 | ||||
-rw-r--r-- | chrome/browser/importer/importer.h | 47 | ||||
-rw-r--r-- | chrome/browser/importer/mork_reader.cc | 2 | ||||
-rw-r--r-- | chrome/browser/importer/mork_reader.h | 9 |
13 files changed, 83 insertions, 38 deletions
diff --git a/chrome/browser/importer/firefox2_importer.cc b/chrome/browser/importer/firefox2_importer.cc index 7e680fb..83e391e 100644 --- a/chrome/browser/importer/firefox2_importer.cc +++ b/chrome/browser/importer/firefox2_importer.cc @@ -7,7 +7,9 @@ #include "app/l10n_util.h" #include "base/file_path.h" #include "base/file_util.h" +#include "base/message_loop.h" #include "base/path_service.h" +#include "base/stl_util-inl.h" #include "base/string_util.h" #include "base/values.h" #include "chrome/browser/importer/firefox_importer_utils.h" @@ -18,6 +20,7 @@ #include "chrome/common/url_constants.h" #include "grit/generated_resources.h" #include "net/base/data_url.h" +#include "webkit/glue/password_form.h" using base::Time; using webkit_glue::PasswordForm; diff --git a/chrome/browser/importer/firefox3_importer.cc b/chrome/browser/importer/firefox3_importer.cc index 8e739982..cad7044 100644 --- a/chrome/browser/importer/firefox3_importer.cc +++ b/chrome/browser/importer/firefox3_importer.cc @@ -8,12 +8,17 @@ #include "app/l10n_util.h" #include "base/file_util.h" +#include "base/message_loop.h" #include "base/scoped_ptr.h" +#include "base/stl_util-inl.h" #include "base/string_util.h" #include "chrome/browser/importer/firefox2_importer.h" #include "chrome/browser/importer/firefox_importer_utils.h" +#include "chrome/browser/search_engines/template_url.h" #include "chrome/common/time_format.h" +#include "chrome/common/sqlite_utils.h" #include "grit/generated_resources.h" +#include "webkit/glue/password_form.h" using base::Time; using webkit_glue::PasswordForm; diff --git a/chrome/browser/importer/firefox3_importer.h b/chrome/browser/importer/firefox3_importer.h index a8b54ff..12a678f 100644 --- a/chrome/browser/importer/firefox3_importer.h +++ b/chrome/browser/importer/firefox3_importer.h @@ -11,9 +11,10 @@ #include "base/basictypes.h" #include "chrome/browser/importer/importer.h" -#include "chrome/common/sqlite_utils.h" #include "googleurl/src/gurl.h" +struct sqlite3; + // Importer for Mozilla Firefox 3. // Firefox 3 stores its persistent information in a new system called places. // http://wiki.mozilla.org/Places diff --git a/chrome/browser/importer/firefox_importer_utils.cc b/chrome/browser/importer/firefox_importer_utils.cc index df0e5aa..0b2b89f 100644 --- a/chrome/browser/importer/firefox_importer_utils.cc +++ b/chrome/browser/importer/firefox_importer_utils.cc @@ -6,14 +6,17 @@ #include <algorithm> +#include "base/file_util.h" #include "base/logging.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" +#include "base/values.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_model.h" #include "chrome/browser/search_engines/template_url_parser.h" #include "googleurl/src/gurl.h" #include "net/base/base64.h" +#include "webkit/glue/password_form.h" using webkit_glue::PasswordForm; diff --git a/chrome/browser/importer/firefox_importer_utils.h b/chrome/browser/importer/firefox_importer_utils.h index 47deecf..21fb43d 100644 --- a/chrome/browser/importer/firefox_importer_utils.h +++ b/chrome/browser/importer/firefox_importer_utils.h @@ -5,16 +5,21 @@ #ifndef CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ #define CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ +#include <vector> + #include "base/basictypes.h" -#include "base/file_util.h" +#include "base/file_path.h" #include "base/native_library.h" -#include "base/values.h" #include "build/build_config.h" -#include "webkit/glue/password_form.h" +class DictionaryValue; class GURL; class TemplateURL; +namespace webkit_glue { +struct PasswordForm; +} + #if defined(OS_WIN) // Detects which version of Firefox is installed from registry. Returns its // major version, and drops the minor version. Returns 0 if diff --git a/chrome/browser/importer/firefox_importer_utils_linux.cc b/chrome/browser/importer/firefox_importer_utils_linux.cc index 66f39a1..3dff06c 100644 --- a/chrome/browser/importer/firefox_importer_utils_linux.cc +++ b/chrome/browser/importer/firefox_importer_utils_linux.cc @@ -4,6 +4,8 @@ #include "chrome/browser/importer/firefox_importer_utils.h" +#include "base/file_util.h" + FilePath GetProfilesINI() { FilePath ini_file; // The default location of the profile folder containing user data is diff --git a/chrome/browser/importer/firefox_importer_utils_mac.cc b/chrome/browser/importer/firefox_importer_utils_mac.cc index 9fb3cf5..7b510ac 100644 --- a/chrome/browser/importer/firefox_importer_utils_mac.cc +++ b/chrome/browser/importer/firefox_importer_utils_mac.cc @@ -4,6 +4,7 @@ #include "chrome/browser/importer/firefox_importer_utils.h" +#include "base/file_util.h" #include "base/logging.h" FilePath GetProfilesINI() { diff --git a/chrome/browser/importer/firefox_importer_utils_win.cc b/chrome/browser/importer/firefox_importer_utils_win.cc index 96ca096..cb09aa1 100644 --- a/chrome/browser/importer/firefox_importer_utils_win.cc +++ b/chrome/browser/importer/firefox_importer_utils_win.cc @@ -6,6 +6,7 @@ #include <shlobj.h> +#include "base/file_util.h" #include "base/registry.h" namespace { diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/browser/importer/ie_importer.cc index 9db6396..ac345a7 100644 --- a/chrome/browser/importer/ie_importer.cc +++ b/chrome/browser/importer/ie_importer.cc @@ -27,6 +27,7 @@ #include "chrome/common/url_constants.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" +#include "webkit/glue/password_form.h" using base::Time; using webkit_glue::PasswordForm; diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc index b9f4600..f311540 100644 --- a/chrome/browser/importer/importer.cc +++ b/chrome/browser/importer/importer.cc @@ -14,6 +14,7 @@ #endif #include "base/file_util.h" #include "base/gfx/png_encoder.h" +#include "base/message_loop.h" #include "base/string_util.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/browser.h" @@ -28,6 +29,9 @@ #include "chrome/browser/importer/ie_importer.h" #endif #include "chrome/browser/importer/toolbar_importer.h" +#if defined(OS_WIN) +#include "chrome/browser/password_manager/ie7_password.h" +#endif #include "chrome/browser/renderer_host/site_instance.h" #include "chrome/browser/search_engines/template_url_model.h" #include "chrome/browser/shell_integration.h" @@ -38,6 +42,7 @@ #include "grit/generated_resources.h" #include "skia/ext/image_operations.h" #include "webkit/glue/image_decoder.h" +#include "webkit/glue/password_form.h" // TODO(port): Port these files. #if defined(OS_WIN) @@ -371,6 +376,34 @@ bool ProfileWriter::DoesBookmarkExist( // Importer. +Importer::Importer() + : main_loop_(MessageLoop::current()), + delagate_loop_(NULL), + importer_host_(NULL), + cancelled_(false), + import_to_bookmark_bar_(false) { +} + +void Importer::NotifyItemStarted(ImportItem item) { + main_loop_->PostTask(FROM_HERE, NewRunnableMethod(importer_host_, + &ImporterHost::ImportItemStarted, item)); +} + +void Importer::NotifyItemEnded(ImportItem item) { + main_loop_->PostTask(FROM_HERE, NewRunnableMethod(importer_host_, + &ImporterHost::ImportItemEnded, item)); +} + +void Importer::NotifyStarted() { + main_loop_->PostTask(FROM_HERE, NewRunnableMethod(importer_host_, + &ImporterHost::ImportStarted)); +} + +void Importer::NotifyEnded() { + main_loop_->PostTask(FROM_HERE, + NewRunnableMethod(importer_host_, &ImporterHost::ImportEnded)); +} + // static bool Importer::ReencodeFavicon(const unsigned char* src_data, size_t src_len, std::vector<unsigned char>* png_data) { diff --git a/chrome/browser/importer/importer.h b/chrome/browser/importer/importer.h index 67f7cc4..839725a 100644 --- a/chrome/browser/importer/importer.h +++ b/chrome/browser/importer/importer.h @@ -5,24 +5,28 @@ #ifndef CHROME_BROWSER_IMPORTER_IMPORTER_H_ #define CHROME_BROWSER_IMPORTER_IMPORTER_H_ -#include <set> +#include <string> #include <vector> #include "build/build_config.h" #include "base/basictypes.h" -#include "base/message_loop.h" +#include "base/gfx/native_widget_types.h" #include "base/ref_counted.h" -#include "chrome/browser/bookmarks/bookmark_model.h" +#include "chrome/browser/bookmarks/bookmark_model_observer.h" #include "chrome/browser/history/history_types.h" -#if defined(OS_WIN) -#include "chrome/browser/password_manager/ie7_password.h" -#endif #include "chrome/browser/profile.h" -#include "chrome/browser/search_engines/template_url.h" #include "chrome/common/notification_registrar.h" #include "googleurl/src/gurl.h" -#include "webkit/glue/password_form.h" + +class MessageLoop; +class TemplateURL; + +struct IE7PasswordInfo; + +namespace webkit_glue { +struct PasswordForm; +} // An enumeration of the type of browsers that we support to import // settings and data from them. @@ -351,38 +355,21 @@ class Importer : public base::RefCounted<Importer> { bool cancelled() const { return cancelled_; } protected: - Importer() - : main_loop_(MessageLoop::current()), - delagate_loop_(NULL), - importer_host_(NULL), - cancelled_(false), - import_to_bookmark_bar_(false) {} + Importer(); // Notifies the coordinator that the collection of data for the specified // item has begun. - void NotifyItemStarted(ImportItem item) { - main_loop_->PostTask(FROM_HERE, NewRunnableMethod(importer_host_, - &ImporterHost::ImportItemStarted, item)); - } + void NotifyItemStarted(ImportItem item); // Notifies the coordinator that the collection of data for the specified // item has completed. - void NotifyItemEnded(ImportItem item) { - main_loop_->PostTask(FROM_HERE, NewRunnableMethod(importer_host_, - &ImporterHost::ImportItemEnded, item)); - } + void NotifyItemEnded(ImportItem item); // Notifies the coordinator that the import operation has begun. - void NotifyStarted() { - main_loop_->PostTask(FROM_HERE, NewRunnableMethod(importer_host_, - &ImporterHost::ImportStarted)); - } + void NotifyStarted(); // Notifies the coordinator that the entire import operation has completed. - void NotifyEnded() { - main_loop_->PostTask(FROM_HERE, - NewRunnableMethod(importer_host_, &ImporterHost::ImportEnded)); - } + void NotifyEnded(); // Given raw image data, decodes the icon, re-sampling to the correct size as // necessary, and re-encodes as PNG data in the given output vector. Returns diff --git a/chrome/browser/importer/mork_reader.cc b/chrome/browser/importer/mork_reader.cc index 7f5e5c6..5352902 100644 --- a/chrome/browser/importer/mork_reader.cc +++ b/chrome/browser/importer/mork_reader.cc @@ -46,9 +46,11 @@ #include "base/file_path.h" #include "base/logging.h" +#include "base/message_loop.h" #include "base/string_util.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/importer/firefox_importer_utils.h" +#include "chrome/browser/importer/importer.h" using base::Time; diff --git a/chrome/browser/importer/mork_reader.h b/chrome/browser/importer/mork_reader.h index 1e54b93..d4844a0 100644 --- a/chrome/browser/importer/mork_reader.h +++ b/chrome/browser/importer/mork_reader.h @@ -42,15 +42,16 @@ #ifndef CHROME_BROWSER_IMPORTER_MORK_READER_H__ #define CHROME_BROWSER_IMPORTER_MORK_READER_H__ -#include <map> -#include <iostream> +#include <iosfwd> #include <fstream> +#include <map> #include <string> #include <vector> #include "base/basictypes.h" -#include "base/stack_container.h" -#include "chrome/browser/importer/importer.h" + +class MessageLoop; +class ProfileWriter; // The nsMorkReader object allows a consumer to read in a mork-format // file and enumerate the rows that it contains. It does not provide |