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

Unified Diff: chrome/browser/ui/webui/options/import_data_handler.cc

Issue 7619003: Don't show import success message if the user cancels the import. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 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
« no previous file with comments | « chrome/browser/ui/webui/options/import_data_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/import_data_handler.cc
diff --git a/chrome/browser/ui/webui/options/import_data_handler.cc b/chrome/browser/ui/webui/options/import_data_handler.cc
index 5c0b49bd1d42add9205502abe03905538eeaad85..dabc43d602f42017bda4cd3cd1b6d983fb13befb 100644
--- a/chrome/browser/ui/webui/options/import_data_handler.cc
+++ b/chrome/browser/ui/webui/options/import_data_handler.cc
@@ -99,6 +99,7 @@ void ImportDataHandler::ImportData(const ListValue* args) {
base::FundamentalValue state(true);
web_ui_->CallJavascriptFunction("ImportDataOverlay.setImportingState",
state);
+ import_did_succeed_ = false;
// 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
@@ -155,11 +156,19 @@ void ImportDataHandler::ImportItemStarted(importer::ImportItem item) {
void ImportDataHandler::ImportItemEnded(importer::ImportItem item) {
// TODO(csilv): show progress detail in the web view.
+ import_did_succeed_ = true;
}
void ImportDataHandler::ImportEnded() {
importer_host_->SetObserver(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");
+ }
}
« no previous file with comments | « chrome/browser/ui/webui/options/import_data_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698