OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_ | |
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_ | |
7 | |
8 #include "components/infobars/core/infobar_delegate.h" | |
9 | |
10 class InfoBarService; | |
11 | |
12 namespace chrome { | |
13 namespace android { | |
14 | |
15 // An infobar that asks if user wants to continue downloading when there is | |
16 // 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.
| |
17 // a new file will be created. | |
18 // Note that this infobar does not expire if the user subsequently navigates, | |
19 // since such navigations won't automatically cancel the underlying download. | |
20 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.
| |
21 public: | |
22 // This is called when the user chooses to download the url. | |
23 // If handling the operation results in dismissing the infobar, returns false | |
24 // (i.e. the caller must not dismiss the infobar). | |
25 virtual bool Download() = 0; | |
26 | |
27 // This is called when the user chooses to cancel the download. | |
28 // If handling the operation results in dismissing the infobar, returns false | |
29 // (i.e. the caller must not dismiss the infobar). | |
30 virtual bool Cancel() = 0; | |
31 | |
32 // Gets the file path to be downloaded. | |
33 virtual std::string GetFilePath() const = 0; | |
34 | |
35 // Whether the download is for offline page. | |
36 virtual bool IsOfflinePage() const; | |
37 | |
38 virtual std::string GetPageURL() const; | |
39 | |
40 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
| |
41 }; | |
42 | |
43 } // namespace android | |
44 } // namespace chrome | |
45 | |
46 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H _ | |
OLD | NEW |