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

Unified Diff: chrome/browser/android/download/android_download_manager_overwrite_infobar_delegate.cc

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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/download/android_download_manager_overwrite_infobar_delegate.cc
diff --git a/chrome/browser/android/download/android_download_manager_overwrite_infobar_delegate.cc b/chrome/browser/android/download/android_download_manager_overwrite_infobar_delegate.cc
deleted file mode 100644
index 7eae0f4d0f409174b014e1c039e3622f459decfa..0000000000000000000000000000000000000000
--- a/chrome/browser/android/download/android_download_manager_overwrite_infobar_delegate.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/android/download/android_download_manager_overwrite_infobar_delegate.h"
-
-#include <memory>
-
-#include "base/android/jni_string.h"
-#include "base/files/file_util.h"
-#include "base/memory/ptr_util.h"
-#include "base/strings/stringprintf.h"
-#include "chrome/browser/android/download/chrome_download_delegate.h"
-#include "chrome/browser/infobars/infobar_service.h"
-#include "chrome/browser/ui/android/infobars/download_overwrite_infobar.h"
-#include "components/infobars/core/infobar.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/web_contents.h"
-
-using base::android::ScopedJavaLocalRef;
-
-namespace chrome {
-namespace android {
-
-AndroidDownloadManagerOverwriteInfoBarDelegate::
- ~AndroidDownloadManagerOverwriteInfoBarDelegate() {
-}
-
-// static
-void AndroidDownloadManagerOverwriteInfoBarDelegate::Create(
- InfoBarService* infobar_service,
- const std::string& file_name,
- const std::string& dir_name,
- const std::string& dir_full_path,
- jobject chrome_download_delegate,
- jobject download_info) {
- infobar_service->AddInfoBar(DownloadOverwriteInfoBar::CreateInfoBar(
- base::WrapUnique(new AndroidDownloadManagerOverwriteInfoBarDelegate(
- file_name, dir_name, dir_full_path, chrome_download_delegate,
- download_info))));
-}
-
-AndroidDownloadManagerOverwriteInfoBarDelegate::
- AndroidDownloadManagerOverwriteInfoBarDelegate(
- const std::string& file_name,
- const std::string& dir_name,
- const std::string& dir_full_path,
- jobject chrome_download_delegate,
- jobject download_info)
- : file_name_(file_name),
- dir_name_(dir_name),
- dir_full_path_(dir_full_path) {
- JNIEnv* env = base::android::AttachCurrentThread();
- chrome_download_delegate_.Reset(env, chrome_download_delegate);
- download_info_.Reset(env, download_info);
-}
-
-infobars::InfoBarDelegate::InfoBarIdentifier
-AndroidDownloadManagerOverwriteInfoBarDelegate::GetIdentifier() const {
- return ANDROID_DOWNLOAD_MANAGER_OVERWRITE_INFOBAR_DELEGATE;
-}
-
-bool AndroidDownloadManagerOverwriteInfoBarDelegate::OverwriteExistingFile() {
- bool tab_closed = ChromeDownloadDelegate::EnqueueDownloadManagerRequest(
- chrome_download_delegate_.obj(), true, download_info_.obj());
- return !tab_closed;
-}
-
-bool AndroidDownloadManagerOverwriteInfoBarDelegate::CreateNewFile() {
- bool tab_closed = ChromeDownloadDelegate::EnqueueDownloadManagerRequest(
- chrome_download_delegate_.obj(), false, download_info_.obj());
- return !tab_closed;
-}
-
-std::string AndroidDownloadManagerOverwriteInfoBarDelegate::GetFileName()
- const {
- return file_name_;
-}
-
-std::string AndroidDownloadManagerOverwriteInfoBarDelegate::GetDirName() const {
- return dir_name_;
-}
-
-std::string AndroidDownloadManagerOverwriteInfoBarDelegate::GetDirFullPath()
- const {
- return dir_full_path_;
-}
-
-} // namespace android
-} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698