OLD | NEW |
| (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_ | |
OLD | NEW |