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

Side by Side Diff: chrome/browser/download/download_ui_controller.cc

Issue 2848723004: Fix an issue that notification is not posted if download is interrupted on start (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/download/download_ui_controller.h" 5 #include "chrome/browser/download/download_ui_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 AndroidUIControllerDelegate() {} 42 AndroidUIControllerDelegate() {}
43 ~AndroidUIControllerDelegate() override {} 43 ~AndroidUIControllerDelegate() override {}
44 44
45 private: 45 private:
46 // DownloadUIController::Delegate 46 // DownloadUIController::Delegate
47 void OnNewDownloadReady(content::DownloadItem* item) override; 47 void OnNewDownloadReady(content::DownloadItem* item) override;
48 }; 48 };
49 49
50 void AndroidUIControllerDelegate::OnNewDownloadReady( 50 void AndroidUIControllerDelegate::OnNewDownloadReady(
51 content::DownloadItem* item) { 51 content::DownloadItem* item) {
52 // The Android DownloadController is only interested in IN_PROGRESS downloads.
53 // Ones which are INTERRUPTED etc. can't be handed over to the Android
54 // DownloadManager.
55 if (item->GetState() != content::DownloadItem::IN_PROGRESS)
56 return;
57
58 DownloadControllerBase::Get()->OnDownloadStarted(item); 52 DownloadControllerBase::Get()->OnDownloadStarted(item);
59 } 53 }
60 54
61 #else // OS_ANDROID 55 #else // OS_ANDROID
62 56
63 class DownloadShelfUIControllerDelegate 57 class DownloadShelfUIControllerDelegate
64 : public DownloadUIController::Delegate { 58 : public DownloadUIController::Delegate {
65 public: 59 public:
66 // |profile| is required to outlive DownloadShelfUIControllerDelegate. 60 // |profile| is required to outlive DownloadShelfUIControllerDelegate.
67 explicit DownloadShelfUIControllerDelegate(Profile* profile) 61 explicit DownloadShelfUIControllerDelegate(Profile* profile)
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 168 }
175 } 169 }
176 #endif 170 #endif
177 171
178 if (item->GetState() == content::DownloadItem::CANCELLED) 172 if (item->GetState() == content::DownloadItem::CANCELLED)
179 return; 173 return;
180 174
181 DownloadItemModel(item).SetWasUINotified(true); 175 DownloadItemModel(item).SetWasUINotified(true);
182 delegate_->OnNewDownloadReady(item); 176 delegate_->OnNewDownloadReady(item);
183 } 177 }
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698