 Chromium Code Reviews
 Chromium Code Reviews Issue 2478583004:
  implementation for new duplicate download UI  (Closed)
    
  
    Issue 2478583004:
  implementation for new duplicate download UI  (Closed) 
  | Index: chrome/browser/android/download/duplicate_download_infobar_delegate.h | 
| diff --git a/chrome/browser/android/download/duplicate_download_infobar_delegate.h b/chrome/browser/android/download/duplicate_download_infobar_delegate.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..dfbf6cf1fa519e214785a0f57cdfc9ab548d0a5d | 
| --- /dev/null | 
| +++ b/chrome/browser/android/download/duplicate_download_infobar_delegate.h | 
| @@ -0,0 +1,46 @@ | 
| +// Copyright 2016 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +#ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_ | 
| +#define CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_ | 
| + | 
| +#include "components/infobars/core/infobar_delegate.h" | 
| + | 
| +class InfoBarService; | 
| + | 
| +namespace chrome { | 
| +namespace android { | 
| + | 
| +// An infobar that asks if user wants to continue downloading when there is | 
| +// already a duplicate file on the sdcard. If user chooses to proceed, | 
| 
gone
2016/11/07 19:45:55
the sdcard -> in storage?
 
qinmin
2016/11/08 00:30:50
Done.
 | 
| +// a new file will be created. | 
| +// Note that this infobar does not expire if the user subsequently navigates, | 
| +// since such navigations won't automatically cancel the underlying download. | 
| +class DuplicateDownloadInfoBarDelegate : public infobars::InfoBarDelegate { | 
| 
gone
2016/11/07 19:45:55
Make this a ConfirmInfoBarDelegate subclass, then
 
qinmin
2016/11/08 00:30:50
Done.
 | 
| + public: | 
| + // This is called when the user chooses to download the url. | 
| + // If handling the operation results in dismissing the infobar, returns false | 
| + // (i.e. the caller must not dismiss the infobar). | 
| + virtual bool Download() = 0; | 
| + | 
| + // This is called when the user chooses to cancel the download. | 
| + // If handling the operation results in dismissing the infobar, returns false | 
| + // (i.e. the caller must not dismiss the infobar). | 
| + virtual bool Cancel() = 0; | 
| + | 
| + // Gets the file path to be downloaded. | 
| + virtual std::string GetFilePath() const = 0; | 
| + | 
| + // Whether the download is for offline page. | 
| + virtual bool IsOfflinePage() const; | 
| + | 
| + virtual std::string GetPageURL() const; | 
| + | 
| + bool ShouldExpire(const NavigationDetails& details) const override; | 
| 
gone
2016/11/07 19:45:55
DISALLOW_COPY_AND_ASSIGN
 
qinmin
2016/11/08 00:30:50
This is a pure virtual class, so DISALLOW_COPY_AND
 | 
| +}; | 
| + | 
| +} // namespace android | 
| +} // namespace chrome | 
| + | 
| +#endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_ |