OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
Ted C
2014/10/14 01:25:37
no (c)
Changwan Ryu
2014/10/14 04:04:40
Done.
| |
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_OVERWRITE_INFOBAR_DELEGATE_H_ | |
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "base/files/file_path.h" | |
10 #include "components/infobars/core/infobar_delegate.h" | |
11 | |
12 namespace content { | |
13 class DownloadItem; | |
14 } | |
15 | |
16 namespace chrome { | |
17 namespace android { | |
18 | |
19 class DownloadOverwriteInfoBarDelegate : public infobars::InfoBarDelegate { | |
Ted C
2014/10/14 01:25:37
Similar question about whether we should be using
Changwan Ryu
2014/10/14 04:04:40
As explained elsewhere, this requires some unique
| |
20 public: | |
21 typedef base::Callback<void(const base::FilePath& virtual_path)> | |
22 FileSelectedCallback; | |
23 virtual ~DownloadOverwriteInfoBarDelegate(); | |
24 static infobars::InfoBar* Create( | |
25 content::DownloadItem* download, | |
26 const base::FilePath& suggested_path, | |
27 const FileSelectedCallback& callback); | |
28 | |
29 // InfoBarDelegate: | |
30 virtual DownloadOverwriteInfoBarDelegate* | |
31 AsDownloadOverwriteInfoBarDelegate() override; | |
32 | |
33 bool Accept(); | |
34 bool Cancel(); | |
35 std::string GetFileName() const; | |
36 std::string GetDirName() const; | |
37 std::string GetDirFullPath() const; | |
38 | |
39 protected: | |
40 DownloadOverwriteInfoBarDelegate( | |
41 content::DownloadItem* download, | |
42 const base::FilePath& suggested_path, | |
43 const FileSelectedCallback& callback); | |
44 | |
45 private: | |
46 int pending_id_; | |
47 base::FilePath suggested_path_; | |
48 FileSelectedCallback callback_; | |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(DownloadOverwriteInfoBarDelegate); | |
51 }; | |
52 | |
53 } // namespace android | |
54 } // namespace chrome | |
55 | |
56 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_H_ | |
OLD | NEW |