Commit 7c34c1d5 authored by isherman@chromium.org's avatar isherman@chromium.org

Don't show import success message if the user cancels the import.

BUG=88947
TEST=none


Review URL: http://codereview.chromium.org/7619003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96518 0039d316-1c4b-4281-b951-d872f2087c98
parent 8da9f7d4
...@@ -99,6 +99,7 @@ void ImportDataHandler::ImportData(const ListValue* args) { ...@@ -99,6 +99,7 @@ void ImportDataHandler::ImportData(const ListValue* args) {
base::FundamentalValue state(true); base::FundamentalValue state(true);
web_ui_->CallJavascriptFunction("ImportDataOverlay.setImportingState", web_ui_->CallJavascriptFunction("ImportDataOverlay.setImportingState",
state); state);
import_did_succeed_ = false;
// TODO(csilv): Out-of-process import has only been qualified on MacOS X, // TODO(csilv): Out-of-process import has only been qualified on MacOS X,
// so we will only use it on that platform since it is required. Remove this // so we will only use it on that platform since it is required. Remove this
...@@ -155,11 +156,19 @@ void ImportDataHandler::ImportItemStarted(importer::ImportItem item) { ...@@ -155,11 +156,19 @@ void ImportDataHandler::ImportItemStarted(importer::ImportItem item) {
void ImportDataHandler::ImportItemEnded(importer::ImportItem item) { void ImportDataHandler::ImportItemEnded(importer::ImportItem item) {
// TODO(csilv): show progress detail in the web view. // TODO(csilv): show progress detail in the web view.
import_did_succeed_ = true;
} }
void ImportDataHandler::ImportEnded() { void ImportDataHandler::ImportEnded() {
importer_host_->SetObserver(NULL); importer_host_->SetObserver(NULL);
importer_host_ = NULL; importer_host_ = NULL;
web_ui_->CallJavascriptFunction("ImportDataOverlay.confirmSuccess"); if (import_did_succeed_) {
web_ui_->CallJavascriptFunction("ImportDataOverlay.confirmSuccess");
} else {
base::FundamentalValue state(false);
web_ui_->CallJavascriptFunction("ImportDataOverlay.setImportingState",
state);
web_ui_->CallJavascriptFunction("ImportDataOverlay.dismiss");
}
} }
...@@ -50,6 +50,8 @@ class ImportDataHandler : public OptionsPageUIHandler, ...@@ -50,6 +50,8 @@ class ImportDataHandler : public OptionsPageUIHandler,
// of deleting itself when import is complete. // of deleting itself when import is complete.
ImporterHost* importer_host_; // weak ImporterHost* importer_host_; // weak
bool import_did_succeed_;
DISALLOW_COPY_AND_ASSIGN(ImportDataHandler); DISALLOW_COPY_AND_ASSIGN(ImportDataHandler);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment