Index: chrome/browser/ui/webui/options2/import_data_handler2.cc |
diff --git a/chrome/browser/ui/webui/options2/import_data_handler2.cc b/chrome/browser/ui/webui/options2/import_data_handler2.cc |
index 7a1ffe35ed4489a8b4b32620910d27e998800742..71720637f7c32dcdd0d50046cb05f4adc43f0423 100644 |
--- a/chrome/browser/ui/webui/options2/import_data_handler2.cc |
+++ b/chrome/browser/ui/webui/options2/import_data_handler2.cc |
@@ -28,7 +28,8 @@ |
namespace options2 { |
ImportDataHandler::ImportDataHandler() : importer_host_(NULL), |
- import_did_succeed_(false) { |
+ import_did_succeed_(false), |
+ profiles_loaded_(false) { |
} |
ImportDataHandler::~ImportDataHandler() { |
@@ -61,9 +62,10 @@ void ImportDataHandler::GetLocalizedValues(DictionaryValue* localized_strings) { |
IDS_IMPORT_SETTINGS_TITLE); |
} |
-void ImportDataHandler::Initialize() { |
+void ImportDataHandler::InitializeHandler() { |
Profile* profile = Profile::FromWebUI(web_ui()); |
importer_list_ = new ImporterList(profile->GetRequestContext()); |
+ profiles_loaded_ = false; |
importer_list_->DetectSourceProfiles(this); |
} |
@@ -128,6 +130,14 @@ void ImportDataHandler::ImportData(const ListValue* args) { |
} |
void ImportDataHandler::OnSourceProfilesLoaded() { |
+ profiles_loaded_ = true; |
+ InitializePage(); |
+} |
+ |
+void ImportDataHandler::InitializePage() { |
+ if (!profiles_loaded_) |
+ return; |
+ |
ListValue browser_profiles; |
for (size_t i = 0; i < importer_list_->count(); ++i) { |
const importer::SourceProfile& source_profile = |