Chromium Code Reviews| Index: chrome/browser/android/download_overwrite_infobar_delegate.h |
| diff --git a/chrome/browser/android/download_overwrite_infobar_delegate.h b/chrome/browser/android/download_overwrite_infobar_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c4de0739930b98c99d769d524a74d82e5a44a206 |
| --- /dev/null |
| +++ b/chrome/browser/android/download_overwrite_infobar_delegate.h |
| @@ -0,0 +1,56 @@ |
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
|
Ted C
2014/10/14 01:25:37
no (c)
Changwan Ryu
2014/10/14 04:04:40
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_H_ |
| +#define CHROME_BROWSER_ANDROID_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_H_ |
| + |
| +#include "base/callback.h" |
| +#include "base/files/file_path.h" |
| +#include "components/infobars/core/infobar_delegate.h" |
| + |
| +namespace content { |
| +class DownloadItem; |
| +} |
| + |
| +namespace chrome { |
| +namespace android { |
| + |
| +class DownloadOverwriteInfoBarDelegate : public infobars::InfoBarDelegate { |
|
Ted C
2014/10/14 01:25:37
Similar question about whether we should be using
Changwan Ryu
2014/10/14 04:04:40
As explained elsewhere, this requires some unique
|
| + public: |
| + typedef base::Callback<void(const base::FilePath& virtual_path)> |
| + FileSelectedCallback; |
| + virtual ~DownloadOverwriteInfoBarDelegate(); |
| + static infobars::InfoBar* Create( |
| + content::DownloadItem* download, |
| + const base::FilePath& suggested_path, |
| + const FileSelectedCallback& callback); |
| + |
| + // InfoBarDelegate: |
| + virtual DownloadOverwriteInfoBarDelegate* |
| + AsDownloadOverwriteInfoBarDelegate() override; |
| + |
| + bool Accept(); |
| + bool Cancel(); |
| + std::string GetFileName() const; |
| + std::string GetDirName() const; |
| + std::string GetDirFullPath() const; |
| + |
| + protected: |
| + DownloadOverwriteInfoBarDelegate( |
| + content::DownloadItem* download, |
| + const base::FilePath& suggested_path, |
| + const FileSelectedCallback& callback); |
| + |
| + private: |
| + int pending_id_; |
| + base::FilePath suggested_path_; |
| + FileSelectedCallback callback_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DownloadOverwriteInfoBarDelegate); |
| +}; |
| + |
| +} // namespace android |
| +} // namespace chrome |
| + |
| +#endif // CHROME_BROWSER_ANDROID_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_H_ |