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

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: used Java DownloadInfo and fixed nits 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 using base::android::ScopedJavaGlobalRef;
Peter Kasting 2015/03/02 21:05:15 This shouldn't be here (nor the #include it refere
Changwan Ryu 2015/03/04 05:15:03 Done.
15
16 class InfoBarService;
17
18 namespace chrome {
19 namespace android {
20
21 // An infobar that asks if it is ok to overwrite an
22 // existing file. Due to limited disk space on Android, two options are
23 // presented to the user when downloading a file whose name conflicts with an
24 // already present file:
25 //
26 // 1. Overwrite the file.
27 // 2. Create a new file.
28 //
29 // Also, the user can dismiss the infobar to abort the download.
30 //
31 // Note that this infobar does not expire if the user subsequently navigates,
32 // since such navigations won't automatically cancel the underlying download.
33 class DownloadOverwriteInfoBarDelegate : public infobars::InfoBarDelegate {
34 public:
35 // This is called when the user chooses to overwrite the existing file.
36 virtual void OverwriteExistingFile() = 0;
37
38 // This is called when the user chooses to create a new file.
39 virtual void CreateNewFile() = 0;
40
41 // Get the file name to be downloaded.
Peter Kasting 2015/03/02 21:05:15 Nit: "Gets", not "Get" (several places)
Changwan Ryu 2015/03/04 05:15:03 Done.
42 virtual std::string GetFileName() const = 0;
43 // Get the download directory name.
44 virtual std::string GetDirName() const = 0;
45 // Get the full directory path.
46 virtual std::string GetDirFullPath() const = 0;
47
48 bool ShouldExpire(const NavigationDetails& details) const override;
49 };
50
51 } // namespace android
52 } // namespace chrome
53
54 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698