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

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

Issue 580043002: [Android] Prompt with infobar on filename conflict (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: avoided Java-only infobar Created 5 years, 10 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 2015 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_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_NATI VE_INITIATED_H_
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_NATI VE_INITIATED_H_
7
8 #include "base/callback.h"
9 #include "base/files/file_path.h"
10 #include "chrome/browser/android/download/download_overwrite_infobar_delegate.h"
11 #include "chrome/browser/download/download_target_determiner_delegate.h"
12 #include "components/infobars/core/infobar_delegate.h"
13
14 class InfoBarService;
15
16 namespace chrome {
17 namespace android {
18
19 // An infobar delegate that starts from the given file path.
20 class DownloadOverwriteInfoBarDelegateNativeInitiated
21 : public DownloadOverwriteInfoBarDelegate {
22 public:
23 ~DownloadOverwriteInfoBarDelegateNativeInitiated() override;
24
25 static void Create(
26 InfoBarService* infobar_service,
27 const base::FilePath& suggested_download_path,
28 const DownloadTargetDeterminerDelegate::FileSelectedCallback&
29 file_selected_callback);
30
31 // This is called when the user chooses to overwrite the existing file.
32 void OverwriteExistingFile() override;
33
34 // This is called when the user chooses to create a new file.
35 void CreateNewFile() override;
36
37 std::string GetFileName() const override;
Peter Kasting 2015/02/25 06:24:57 Same comments as other header
Changwan Ryu 2015/03/02 14:46:37 Done.
38 std::string GetDirName() const override;
39 std::string GetDirFullPath() const override;
40
41 private:
42 DownloadOverwriteInfoBarDelegateNativeInitiated(
43 const base::FilePath& suggested_path,
44 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback);
45
46 // infobars::InfoBarDelegate:
Peter Kasting 2015/02/25 06:24:57 See comment in other header re: you no longer inhe
Changwan Ryu 2015/03/02 14:46:37 Done.
47 bool ShouldExpire(const infobars::InfoBarDelegate::NavigationDetails& details)
48 const override;
49 void InfoBarDismissed() override;
50
51 // Creates a new file in content::BrowserThread::FILE thread, and when it's
52 // done, calls |callback| in the UI thread.
Peter Kasting 2015/02/25 06:24:57 Nit: Clearer: Called on the FILE thread to create
Changwan Ryu 2015/03/02 14:46:37 Done.
53 static void CreateNewFileInternal(
54 const base::FilePath& suggested_download_path,
55 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback);
56
57 // The suggested download path from download target determiner. This is used
58 // to show users the file name and the directory that will be used.
59 base::FilePath suggested_download_path_;
60
61 // A callback to download target determiner to notify that file selection
62 // is made (or cancelled).
63 DownloadTargetDeterminerDelegate::FileSelectedCallback
64 file_selected_callback_;
65
66 DISALLOW_COPY_AND_ASSIGN(DownloadOverwriteInfoBarDelegateNativeInitiated);
67 };
68
69 } // namespace android
70 } // namespace chrome
71
72 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_N ATIVE_INITIATED_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698