OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_ |
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_ |
7 | 7 |
8 #include "components/infobars/core/confirm_infobar_delegate.h" | 8 #include "components/infobars/core/confirm_infobar_delegate.h" |
9 | 9 |
10 class InfoBarService; | |
11 | |
12 namespace chrome { | 10 namespace chrome { |
13 namespace android { | 11 namespace android { |
14 | 12 |
15 // An infobar that asks if user wants to continue downloading when there is | 13 // An infobar that asks if user wants to continue downloading when there is |
16 // already a duplicate file in storage. If user chooses to proceed, | 14 // already a duplicate file in storage. If user chooses to proceed, |
17 // a new file will be created. | 15 // a new file will be created. |
18 // Note that this infobar does not expire if the user subsequently navigates, | 16 // Note that this infobar does not expire if the user subsequently navigates, |
19 // since such navigations won't automatically cancel the underlying download. | 17 // since such navigations won't automatically cancel the underlying download. |
20 class DuplicateDownloadInfoBarDelegate : public ConfirmInfoBarDelegate { | 18 class DuplicateDownloadInfoBarDelegate : public ConfirmInfoBarDelegate { |
21 public: | 19 public: |
22 // Gets the file path to be downloaded. | 20 // Gets the file path to be downloaded. |
23 virtual std::string GetFilePath() const = 0; | 21 virtual std::string GetFilePath() const = 0; |
24 | 22 |
25 // Whether the download is for offline page. | 23 // Whether the download is for offline page. |
26 virtual bool IsOfflinePage() const; | 24 virtual bool IsOfflinePage() const; |
27 | 25 |
28 virtual std::string GetPageURL() const; | 26 virtual std::string GetPageURL() const; |
29 | 27 |
30 virtual bool IsOffTheRecord() const; | 28 virtual bool IsOffTheRecord() const; |
31 | 29 |
32 // ConfirmInfoBarDelegate implementation. | 30 // ConfirmInfoBarDelegate implementation. |
33 base::string16 GetMessageText() const override; | 31 base::string16 GetMessageText() const override; |
34 bool ShouldExpire(const NavigationDetails& details) const override; | 32 bool ShouldExpire(const NavigationDetails& details) const override; |
35 }; | 33 }; |
36 | 34 |
37 } // namespace android | 35 } // namespace android |
38 } // namespace chrome | 36 } // namespace chrome |
39 | 37 |
40 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H
_ | 38 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H
_ |
OLD | NEW |