summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorrdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 21:02:37 +0000
committerrdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 21:02:37 +0000
commit513b7e3ba99e22c82408f460f370c7cc62b3d346 (patch)
tree2680bb9d73abe819a2d99c85dd3b50096a11f765 /content
parent59e440481c4b7a9eb4f8d2353cc3e0242dbb26b3 (diff)
downloadchromium_src-513b7e3ba99e22c82408f460f370c7cc62b3d346.zip
chromium_src-513b7e3ba99e22c82408f460f370c7cc62b3d346.tar.gz
chromium_src-513b7e3ba99e22c82408f460f370c7cc62b3d346.tar.bz2
Make MaybeCompleteDownload private.
R=asanka@chromium.org Review URL: https://chromiumcodereview.appspot.com/11412202 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/download/download_item_impl.cc9
-rw-r--r--content/browser/download/download_item_impl.h16
-rw-r--r--content/browser/download/download_item_impl_unittest.cc3
-rw-r--r--content/browser/download/download_manager_impl_unittest.cc5
4 files changed, 13 insertions, 20 deletions
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc
index 5e66f9a..3be8661 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -4,11 +4,10 @@
// File method ordering: Methods in this file are in the same order as
// in download_item_impl.h, with the following exception: The public
-// interfaces Start, MaybeCompleteDownload, and OnDownloadCompleting
-// are placed in chronological order with the other (private) routines
-// that together define a DownloadItem's state transitions
-// as the download progresses. See "Download progression cascade" later in
-// this file.
+// interface Start is placed in chronological order with the other
+// (private) routines that together define a DownloadItem's state
+// transitions as the download progresses. See "Download progression
+// cascade" later in this file.
// A regular DownloadItem (created for a download in this session of the
// browser) normally goes through the following states:
diff --git a/content/browser/download/download_item_impl.h b/content/browser/download/download_item_impl.h
index 797c798..b2e0846 100644
--- a/content/browser/download/download_item_impl.h
+++ b/content/browser/download/download_item_impl.h
@@ -154,11 +154,6 @@ class CONTENT_EXPORT DownloadItemImpl
// Start the download
virtual void Start(scoped_ptr<DownloadFile> download_file);
- // If all pre-requisites have been met, complete download processing, i.e. do
- // internal cleanup, file rename, and potentially auto-open. (Dangerous
- // downloads still may block on user acceptance after this point.)
- virtual void MaybeCompleteDownload();
-
// Needed because of interwining with DownloadManagerImpl --------------------
// TODO(rdsmith): Unwind DownloadManagerImpl and DownloadItemImpl,
@@ -260,10 +255,15 @@ class CONTENT_EXPORT DownloadItemImpl
void OnDownloadRenamedToIntermediateName(
DownloadInterruptReason reason, const FilePath& full_path);
+ // If all pre-requisites have been met, complete download processing, i.e. do
+ // internal cleanup, file rename, and potentially auto-open. (Dangerous
+ // downloads still may block on user acceptance after this point.)
+ void MaybeCompleteDownload();
+
// Called when the download is ready to complete.
// This may perform final rename if necessary and will eventually call
// DownloadItem::Completed().
- virtual void OnDownloadCompleting();
+ void OnDownloadCompleting();
// Called after the delegate has given the go-ahead to actually complete
// the download.
@@ -274,7 +274,7 @@ class CONTENT_EXPORT DownloadItemImpl
// Called if the embedder took over opening a download, to indicate that
// the download has been opened.
- virtual void DelayedDownloadOpened(bool auto_opened);
+ void DelayedDownloadOpened(bool auto_opened);
// Called when the entire download operation (including renaming etc)
// is completed.
@@ -283,7 +283,7 @@ class CONTENT_EXPORT DownloadItemImpl
// Helper routines -----------------------------------------------------------
// Indicate that an error has occurred on the download.
- virtual void Interrupt(DownloadInterruptReason reason);
+ void Interrupt(DownloadInterruptReason reason);
// Cancel the DownloadFile if we have it.
void CancelDownloadFile();
diff --git a/content/browser/download/download_item_impl_unittest.cc b/content/browser/download/download_item_impl_unittest.cc
index f338168..21b85c2 100644
--- a/content/browser/download/download_item_impl_unittest.cc
+++ b/content/browser/download/download_item_impl_unittest.cc
@@ -460,13 +460,12 @@ TEST_F(DownloadItemTest, CallbackAfterRename) {
::testing::Mock::VerifyAndClearExpectations(download_file);
::testing::Mock::VerifyAndClearExpectations(mock_delegate());
- item->OnAllDataSaved("");
EXPECT_CALL(*download_file, RenameAndAnnotate(final_path, _))
.WillOnce(ScheduleRenameCallback(final_path));
EXPECT_CALL(*mock_delegate(), ShouldOpenDownload(item, _))
.WillOnce(Return(true));
EXPECT_CALL(*download_file, Detach());
- item->MaybeCompleteDownload();
+ item->DestinationObserverAsWeakPtr()->DestinationCompleted("");
RunAllPendingInMessageLoops();
::testing::Mock::VerifyAndClearExpectations(download_file);
::testing::Mock::VerifyAndClearExpectations(mock_delegate());
diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc
index cfa637c..bc1d9e3 100644
--- a/content/browser/download/download_manager_impl_unittest.cc
+++ b/content/browser/download/download_manager_impl_unittest.cc
@@ -97,7 +97,6 @@ class MockDownloadItemImpl : public DownloadItemImpl {
MOCK_METHOD0(MarkAsComplete, void());
MOCK_METHOD1(OnAllDataSaved, void(const std::string&));
MOCK_METHOD0(OnDownloadedFileRemoved, void());
- MOCK_METHOD0(MaybeCompleteDownload, void());
virtual void Start(
scoped_ptr<DownloadFile> download_file) OVERRIDE {
MockStart(download_file.get());
@@ -561,10 +560,6 @@ class DownloadManagerTest : public testing::Test {
EXPECT_CALL(item, IsInProgress())
.WillOnce(Return(true));
-
- // History addition should result in a call into MaybeCompleteDownload().
- EXPECT_CALL(item, MaybeCompleteDownload())
- .WillOnce(Return());
}
protected: