| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMPLETION_BLOCKER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMPLETION_BLOCKER_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMPLETION_BLOCKER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMPLETION_BLOCKER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" |
| 9 #include "base/supports_user_data.h" | 10 #include "base/supports_user_data.h" |
| 10 #include "content/public/browser/download_item.h" | 11 #include "content/public/browser/download_item.h" |
| 11 | 12 |
| 12 // A subsystem may use a DownloadCompletionBlocker in conjunction with | 13 // A subsystem may use a DownloadCompletionBlocker in conjunction with |
| 13 // DownloadManagerDelegate::ShouldCompleteDownload() in order to block the | 14 // DownloadManagerDelegate::ShouldCompleteDownload() in order to block the |
| 14 // completion of a DownloadItem. CompleteDownload() will run the most recent | 15 // completion of a DownloadItem. CompleteDownload() will run the most recent |
| 15 // callback set. | 16 // callback set. |
| 16 class DownloadCompletionBlocker : public base::SupportsUserData::Data { | 17 class DownloadCompletionBlocker : public base::SupportsUserData::Data { |
| 17 public: | 18 public: |
| 18 DownloadCompletionBlocker(); | 19 DownloadCompletionBlocker(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 32 virtual void CompleteDownload(); | 33 virtual void CompleteDownload(); |
| 33 | 34 |
| 34 private: | 35 private: |
| 35 bool is_complete_; | 36 bool is_complete_; |
| 36 base::Closure callback_; | 37 base::Closure callback_; |
| 37 | 38 |
| 38 DISALLOW_COPY_AND_ASSIGN(DownloadCompletionBlocker); | 39 DISALLOW_COPY_AND_ASSIGN(DownloadCompletionBlocker); |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMPLETION_BLOCKER_H_ | 42 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMPLETION_BLOCKER_H_ |
| OLD | NEW |