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

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: addressed ted's comments 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 2014 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_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 // An infobar delegate for DownloadOverwriteInfoBar implemented for
20 // use by ChromeDownloadManagerDelegate.
Peter Kasting 2014/10/24 01:32:22 Nit: Maybe instead of a comment that's a bunch of
Changwan Ryu 2014/10/27 06:40:04 Done.
21 class DownloadOverwriteInfoBarDelegate : public infobars::InfoBarDelegate {
22 public:
23 // Callback to be invoked when PromptUserForDownloadPath() completes.
24 // Originally defined in download_target_determiner_delegate.h, but
25 // redefined to avoid a template-related compile error.
Peter Kasting 2014/10/24 01:32:22 What error? I'm confused why this needs to be her
Changwan Ryu 2014/10/27 06:40:04 Hmm... Removed as the compiler error isn't reprodu
26 typedef base::Callback<void(const base::FilePath& virtual_path)>
27 FileSelectedCallback;
28 virtual ~DownloadOverwriteInfoBarDelegate();
Peter Kasting 2014/10/24 01:32:22 Nit: Blank line above and below this so each type
Peter Kasting 2014/10/24 01:32:22 Nit: "override" rather than "virtual"
Changwan Ryu 2014/10/27 06:40:04 Done.
Changwan Ryu 2014/10/27 06:40:04 Done.
29 static infobars::InfoBar* Create(
30 content::DownloadItem* download,
31 const base::FilePath& suggested_path,
32 const FileSelectedCallback& callback);
33
34 // InfoBarDelegate:
35 virtual DownloadOverwriteInfoBarDelegate*
Peter Kasting 2014/10/24 01:32:22 Nit: No "virtual" when "override" is present
Changwan Ryu 2014/10/27 06:40:04 Done.
36 AsDownloadOverwriteInfoBarDelegate() override;
37
38 bool Accept();
Peter Kasting 2014/10/24 01:32:22 Nit: Say what Accept() and Cancel() do. Perhaps y
Changwan Ryu 2014/10/27 06:40:04 Done.
39 bool Cancel();
40 std::string GetFileName() const;
41 std::string GetDirName() const;
42 std::string GetDirFullPath() const;
43
44 protected:
45 DownloadOverwriteInfoBarDelegate(
Peter Kasting 2014/10/24 01:32:22 Why is this protected rather than private? No one
Changwan Ryu 2014/10/27 06:40:04 Done.
46 content::DownloadItem* download,
47 const base::FilePath& suggested_path,
48 const FileSelectedCallback& callback);
49
50 private:
51 int pending_id_;
Peter Kasting 2014/10/24 01:32:22 Nit: Document these.
Changwan Ryu 2014/10/27 06:40:04 Done.
52 base::FilePath suggested_path_;
53 FileSelectedCallback callback_;
54
55 DISALLOW_COPY_AND_ASSIGN(DownloadOverwriteInfoBarDelegate);
56 };
57
58 } // namespace android
59 } // namespace chrome
60
61 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698