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

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

Issue 2478583004: implementation for new duplicate download UI (Closed)
Patch Set: do null check on webcontents Created 4 years, 1 month 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_ANDROID_DOWNLOAD_MANAGER_OVERWRITE_INFOB AR_DELEGATE_H_
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_ANDROID_DOWNLOAD_MANAGER_OVERWRITE_INFOB AR_DELEGATE_H_
7
8 #include "base/android/jni_weak_ref.h"
9 #include "base/android/scoped_java_ref.h"
10 #include "base/callback.h"
11 #include "base/files/file_path.h"
12 #include "base/macros.h"
13 #include "chrome/browser/android/download/download_overwrite_infobar_delegate.h"
14 #include "components/infobars/core/infobar_delegate.h"
15
16 class InfoBarService;
17
18 namespace chrome {
19 namespace android {
20
21 // An infobar delegate that is initiated from Java side.
22 class AndroidDownloadManagerOverwriteInfoBarDelegate
23 : public DownloadOverwriteInfoBarDelegate {
24 public:
25 ~AndroidDownloadManagerOverwriteInfoBarDelegate() override;
26
27 static void Create(InfoBarService* infobar_service,
28 const std::string& file_name,
29 const std::string& dir_name,
30 const std::string& dir_full_path,
31 jobject chrome_download_delegate,
32 jobject download_info);
33
34 private:
35 AndroidDownloadManagerOverwriteInfoBarDelegate(
36 const std::string& file_name,
37 const std::string& dir_name,
38 const std::string& dir_full_path,
39 jobject chrome_download_delegate,
40 jobject download_info);
41
42 // DownloadOverwriteInfoBarDelegate:
43 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
44 bool OverwriteExistingFile() override;
45 bool CreateNewFile() override;
46 std::string GetFileName() const override;
47 std::string GetDirName() const override;
48 std::string GetDirFullPath() const override;
49
50 std::string file_name_;
51 std::string dir_name_;
52 std::string dir_full_path_;
53 base::android::ScopedJavaGlobalRef<jobject> chrome_download_delegate_;
54 base::android::ScopedJavaGlobalRef<jobject> download_info_;
55
56 DISALLOW_COPY_AND_ASSIGN(AndroidDownloadManagerOverwriteInfoBarDelegate);
57 };
58
59 } // namespace android
60 } // namespace chrome
61
62 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_ANDROID_DOWNLOAD_MANAGER_OVERWRITE_IN FOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698