Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: chrome/browser/dom_ui/import_data_handler.cc

Issue 3167028: Fix bug in ImportingData Overlay (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: sync Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/dom_ui/import_data_handler.cc
diff --git a/chrome/browser/dom_ui/import_data_handler.cc b/chrome/browser/dom_ui/import_data_handler.cc
index 08332df2f84a69f3c1ec05f9172e8bd9711819be..f771abae33cd93b56e5bde3ae3a2fec429451d15 100644
--- a/chrome/browser/dom_ui/import_data_handler.cc
+++ b/chrome/browser/dom_ui/import_data_handler.cc
@@ -22,11 +22,13 @@ ImportDataHandler::ImportDataHandler() {
}
ImportDataHandler::~ImportDataHandler() {
+ if (importer_host_ != NULL) {
+ importer_host_->SetObserver(NULL);
+ importer_host_ = NULL;
+ }
}
void ImportDataHandler::Initialize() {
- importer_host_ = new ImporterHost();
- DetectSupportedBrowsers();
}
void ImportDataHandler::GetLocalizedValues(
@@ -54,9 +56,16 @@ void ImportDataHandler::GetLocalizedValues(
void ImportDataHandler::RegisterMessages() {
dom_ui_->RegisterMessageCallback(
+ "loadImporter", NewCallback(this, &ImportDataHandler::LoadImporter));
+ dom_ui_->RegisterMessageCallback(
"importData", NewCallback(this, &ImportDataHandler::ImportData));
}
+void ImportDataHandler::LoadImporter(const ListValue* args) {
+ importer_host_ = new ImporterHost();
+ DetectSupportedBrowsers();
+}
+
void ImportDataHandler::DetectSupportedBrowsers() {
ListValue supported_browsers;
int profiles_count = importer_host_->GetAvailableProfileCount();
@@ -120,4 +129,5 @@ void ImportDataHandler::ImportItemEnded(importer::ImportItem item) {
void ImportDataHandler::ImportEnded() {
dom_ui_->CallJavascriptFunction(L"ImportDataOverlay.dismiss");
+ importer_host_ = NULL;
}
« no previous file with comments | « chrome/browser/dom_ui/import_data_handler.h ('k') | chrome/browser/resources/options/import_data_overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698