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

Side by Side Diff: chrome/browser/android/download/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: changed function order according to headers Created 5 years, 9 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_H_
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_H_
7
8 #include "base/android/scoped_java_ref.h"
9 #include "base/callback.h"
10 #include "base/files/file_path.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 that asks if it is ok to overwrite an
20 // existing file. Due to limited disk space on Android, two options are
21 // presented to the user when downloading a file whose name conflicts with an
22 // already present file:
23 //
24 // 1. Overwrite the file.
25 // 2. Create a new file.
26 //
27 // Also, the user can dismiss the infobar to abort the download.
28 //
29 // Note that this infobar does not expire if the user subsequently navigates,
30 // since such navigations won't automatically cancel the underlying download.
31 class DownloadOverwriteInfoBarDelegate : public infobars::InfoBarDelegate {
32 public:
33 // This is called when the user chooses to overwrite the existing file.
34 virtual void OverwriteExistingFile() = 0;
35
36 // This is called when the user chooses to create a new file.
37 virtual void CreateNewFile() = 0;
38
39 // Gets the file name to be downloaded.
40 virtual std::string GetFileName() const = 0;
41 // Gets the download directory name.
42 virtual std::string GetDirName() const = 0;
43 // Gets the full directory path.
44 virtual std::string GetDirFullPath() const = 0;
45
46 bool ShouldExpire(const NavigationDetails& details) const override;
47 };
48
49 } // namespace android
50 } // namespace chrome
51
52 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698