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

Unified Diff: chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.cc

Issue 2400213003: [Offline Pages] Fix several infobar bugs. (Closed)
Patch Set: Address dfalcantara's & qinmin's feedback. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.cc
diff --git a/chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.cc b/chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.cc
index 6b35eba4f99f59a65961214bdc5e4093fc14e5f1..d8427b9e374d41b267a3c506d78c03b56589d8d4 100644
--- a/chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.cc
+++ b/chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.cc
@@ -12,20 +12,25 @@ namespace offline_pages {
// static
void OfflinePageInfoBarDelegate::Create(
- const base::Closure& confirm_continuation,
+ const base::Callback<void(Action)>& confirm_continuation,
+ const std::string& downloads_label,
const std::string& page_name,
content::WebContents* web_contents) {
InfoBarService::FromWebContents(web_contents)
- ->AddInfoBar(DownloadOverwriteInfoBar::CreateInfoBar(base::WrapUnique(
- new OfflinePageInfoBarDelegate(confirm_continuation, page_name))));
+ ->AddInfoBar(DownloadOverwriteInfoBar::CreateInfoBar(
+ base::WrapUnique(new OfflinePageInfoBarDelegate(
+ confirm_continuation, downloads_label, page_name))));
}
OfflinePageInfoBarDelegate::~OfflinePageInfoBarDelegate() {}
OfflinePageInfoBarDelegate::OfflinePageInfoBarDelegate(
- const base::Closure& confirm_continuation,
+ const base::Callback<void(Action)>& confirm_continuation,
+ const std::string& downloads_label,
const std::string& page_name)
- : confirm_continuation_(confirm_continuation), page_name_(page_name) {}
+ : confirm_continuation_(confirm_continuation),
+ downloads_label_(downloads_label),
+ page_name_(page_name) {}
infobars::InfoBarDelegate::InfoBarIdentifier
OfflinePageInfoBarDelegate::GetIdentifier() const {
@@ -41,12 +46,12 @@ bool OfflinePageInfoBarDelegate::EqualsDelegate(
bool OfflinePageInfoBarDelegate::OverwriteExistingFile() {
// TODO(dewittj): Downloads UI intends to remove this functionality.
- confirm_continuation_.Run();
+ confirm_continuation_.Run(Action::OVERWRITE);
return true;
}
bool OfflinePageInfoBarDelegate::CreateNewFile() {
- confirm_continuation_.Run();
+ confirm_continuation_.Run(Action::CREATE_NEW);
return true;
}
@@ -55,9 +60,7 @@ std::string OfflinePageInfoBarDelegate::GetFileName() const {
}
std::string OfflinePageInfoBarDelegate::GetDirName() const {
- // TODO(dewittj): When the downloads infobar can link to download home, use
- // that link.
- return std::string();
+ return downloads_label_;
}
std::string OfflinePageInfoBarDelegate::GetDirFullPath() const {
« no previous file with comments | « chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698