Chromium Code Reviews| 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_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_JAVA _INITIATED_H_ | |
| 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_JAVA _INITIATED_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/files/file_path.h" | |
| 10 #include "chrome/browser/android/download/download_overwrite_info.h" | |
| 11 #include "chrome/browser/android/download/download_overwrite_infobar_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 delegate that is initiated from Java side. | |
| 20 class DownloadOverwriteInfoBarDelegateJavaInitiated | |
|
Ted C
2015/02/26 00:57:56
The names of these two files is odd to me. Is the
Changwan Ryu
2015/03/02 14:46:36
Done.
| |
| 21 : public DownloadOverwriteInfoBarDelegate { | |
| 22 public: | |
| 23 ~DownloadOverwriteInfoBarDelegateJavaInitiated() override; | |
| 24 | |
| 25 typedef base::Callback<void(const DownloadOverwriteInfo&)> | |
|
Peter Kasting
2015/02/25 06:24:57
Typedefs go above members
Changwan Ryu
2015/03/02 14:46:36
I see. Removed now since the callback use case is
| |
| 26 FileSelectedFromDownloadOverwriteInfoCallback; | |
|
Peter Kasting
2015/02/25 06:24:57
Nit: This name seems a bit verbose, can you shorte
Changwan Ryu
2015/03/02 14:46:36
Ditto
| |
| 27 | |
| 28 static void Create(InfoBarService* infobar_service, | |
| 29 const DownloadOverwriteInfo& info, | |
| 30 const FileSelectedFromDownloadOverwriteInfoCallback& | |
| 31 file_selected_callback); | |
| 32 | |
| 33 void OverwriteExistingFile() override; | |
|
Peter Kasting
2015/02/25 06:24:57
Nit: "// DownloadOverwriteInfoBarDelegate:"
How c
Changwan Ryu
2015/03/02 14:46:36
Done.
| |
| 34 void CreateNewFile() override; | |
| 35 std::string GetFileName() const override; | |
| 36 std::string GetDirName() const override; | |
| 37 std::string GetDirFullPath() const override; | |
| 38 | |
| 39 private: | |
| 40 DownloadOverwriteInfoBarDelegateJavaInitiated( | |
| 41 const DownloadOverwriteInfo& info, | |
| 42 const FileSelectedFromDownloadOverwriteInfoCallback& callback); | |
| 43 | |
| 44 // infobars::InfoBarDelegateForDownloadOverwriteInfo: | |
|
Peter Kasting
2015/02/25 06:24:57
This is not a class name? And if you meant to wri
Changwan Ryu
2015/03/02 14:46:36
Done.
| |
| 45 bool ShouldExpire(const infobars::InfoBarDelegate::NavigationDetails& details) | |
| 46 const override; | |
| 47 void InfoBarDismissed() override; | |
| 48 | |
| 49 DownloadOverwriteInfo download_overwrite_info_; | |
| 50 | |
| 51 // A callback to notify that file selection is made (or cancelled). | |
| 52 FileSelectedFromDownloadOverwriteInfoCallback file_selected_callback_; | |
| 53 | |
| 54 DISALLOW_COPY_AND_ASSIGN(DownloadOverwriteInfoBarDelegateJavaInitiated); | |
| 55 }; | |
| 56 | |
| 57 } // namespace android | |
| 58 } // namespace chrome | |
| 59 | |
| 60 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_J AVA_INITIATED_H_ | |
| OLD | NEW |