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

Side by Side Diff: chrome/browser/android/download_overwrite_infobar_delegate.h

Issue 580043002: [Android] Prompt with infobar on filename conflict (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: full implementation Created 6 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 unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698