summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/importing_progress_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/views/importing_progress_view.cc')
-rw-r--r--chrome/browser/views/importing_progress_view.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/views/importing_progress_view.cc b/chrome/browser/views/importing_progress_view.cc
index db4ad1f..0d55d0e 100644
--- a/chrome/browser/views/importing_progress_view.cc
+++ b/chrome/browser/views/importing_progress_view.cc
@@ -185,12 +185,16 @@ std::wstring ImportingProgressView::GetWindowTitle() const {
}
bool ImportingProgressView::Cancel() {
+ // When the user cancels the import, we need to tell the coordinator to stop
+ // importing and return false so that the window lives long enough to receive
+ // ImportEnded, which will close the window. Closing the window results in
+ // another call to this function and at that point we must return true to
+ // allow the window to close.
if (!importing_)
- return true;
+ return true; // We have received ImportEnded, so we can close.
+ // Cancel the import and wait for further instructions.
coordinator_->Cancel();
- // Return false because the window needs to live long enough to receive
- // ImportEnded, which will close the window.
return false;
}