New issue
Advanced search Search tips
Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2013
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 78147



Sign in to add a comment

Refactor downloads UI to be an observer of DownloadManager/DownloadItem

Project Member Reported by asanka@chromium.org, Sep 11 2012

Issue description

Currently the downloads code notifies the UI explicitly when a download is starting and should be displayed to the user. Refactor this code so that the UI is a pure observer.

 

Comment 1 by asanka@chromium.org, Sep 11 2012

Blocking: chromium:78147
Couple of notes about this project:

* The advantage of ShowDownloadInBrowser is that we know which window the download came from, so we only open the shelf in that window.  We'll need to find some way to replace that functionality.

* Currently, the "SetOpened()" method is used by the various UIs to indicate "this download should not prevent future shelf auto-closes".  That's a variable that should probably be pulled out into the UI's external data and the interface removed from the DownloadItem.

Comment 3 by asanka@chromium.org, Dec 27 2012

Blockedon: chromium:167702
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 6 2013

The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=186458

------------------------------------------------------------------------
r186458 | asanka@chromium.org | 2013-03-06T17:43:02.464046Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/ui/browser.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/download/download_item_impl_delegate.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/browser/download_manager_delegate.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/android/download_controller_android_impl.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/extensions/extension_host.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/android_webview/native/aw_web_contents_delegate.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/android_webview/native/aw_web_contents_delegate.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/download/download_item_impl.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/download/download_item_model.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/chrome_browser.gypi?r1=186458&r2=186457&pathrev=186458
   A http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/download/download_ui_controller.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/download/download_manager_impl_unittest.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/download/all_download_item_notifier.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/download/download_manager_impl.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/prerender/prerender_contents.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/chrome_tests_unit.gypi?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/download/chrome_download_manager_delegate.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/download/download_service.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/android/chrome_web_contents_delegate_android.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/download/chrome_download_manager_delegate.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/browser/web_contents_delegate.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/ui/browser.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/android/chrome_web_contents_delegate_android.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/download/download_item_impl_delegate.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/browser/android/download_controller_android.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/browser/download_manager_delegate.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/download/download_item_impl_unittest.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/extensions/extension_host.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/android/download_controller_android_impl.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/download/download_item_impl.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/download/save_package.cc?r1=186458&r2=186457&pathrev=186458
   A http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/download/download_ui_controller_unittest.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/download/download_item_model.h?r1=186458&r2=186457&pathrev=186458
   A http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/download/download_ui_controller.cc?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/download/download_item_factory.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/download/download_manager_impl.h?r1=186458&r2=186457&pathrev=186458
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/download/download_service.cc?r1=186458&r2=186457&pathrev=186458

Make the UI an observer of downloads.

This relieves content/browser/download from knowing who/when to notify regarding a new download.

BUG= 147753 


Review URL: https://chromiumcodereview.appspot.com/11640007
------------------------------------------------------------------------
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 10 2013

Labels: -Feature-Downloads -Area-Internals Cr-Internals Cr-UI-Browser-Downloads
Status: Fixed

Comment 7 by asanka@chromium.org, May 14 2013

Blockedon: -chromium:167702

Sign in to add a comment