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

Side by Side Diff: chrome/browser/android/download/dangerous_download_infobar_delegate.h

Issue 2496983003: Use native implementation of dangerous download infobar (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(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_DANGEROUS_DOWNLOAD_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DANGEROUS_DOWNLOAD_INFOBAR_DELEGATE_H_
7
8 #include "base/macros.h"
9 #include "components/infobars/core/confirm_infobar_delegate.h"
10 #include "content/public/browser/download_item.h"
11
12 class InfoBarService;
13
14 // An infobar that asks if user wants to download a dangerous file.
15 // Note that this infobar does not expire if the user subsequently navigates,
16 // since such navigations won't automatically cancel the underlying download.
17 class DangerousDownloadInfoBarDelegate
18 : public ConfirmInfoBarDelegate,
19 public content::DownloadItem::Observer {
20 public:
21 static void Create(
22 InfoBarService* infobar_service,
23 content::DownloadItem* download_item);
24
25 ~DangerousDownloadInfoBarDelegate() override;
26
27 // content::DownloadItem::Observer:
28 void OnDownloadDestroyed(content::DownloadItem* download_item) override;
29
30 private:
31 explicit DangerousDownloadInfoBarDelegate(
32 content::DownloadItem* download_item);
33
34 // ConfirmInfoBarDelegate:
35 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
36 int GetIconId() const override;
37 bool ShouldExpire(const NavigationDetails& details) const override;
38 void InfoBarDismissed() override;
39 base::string16 GetMessageText() const override;
40 bool Accept() override;
41 bool Cancel() override;
42
43 // The download item that is requesting the infobar. Could get deleted while
44 // the infobar is showing.
45 content::DownloadItem* download_item_;
46
47 DISALLOW_COPY_AND_ASSIGN(DangerousDownloadInfoBarDelegate);
48 };
49
50
51 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DANGEROUS_DOWNLOAD_INFOBAR_DELEGATE_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698