| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/download/download_request_infobar_delegate_android.h" | 5 #include "chrome/browser/download/download_request_infobar_delegate_android.h" |
| 6 | 6 |
| 7 #include "chrome/browser/android/android_theme_resources.h" | 7 #include "chrome/browser/android/android_theme_resources.h" |
| 8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
| 9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
| 10 #include "chrome/grit/theme_resources.h" | |
| 11 #include "components/infobars/core/infobar.h" | 10 #include "components/infobars/core/infobar.h" |
| 12 #include "ui/base/l10n/l10n_util.h" | 11 #include "ui/base/l10n/l10n_util.h" |
| 13 | 12 |
| 14 DownloadRequestInfoBarDelegateAndroid::FakeCreateCallback* | 13 DownloadRequestInfoBarDelegateAndroid::FakeCreateCallback* |
| 15 DownloadRequestInfoBarDelegateAndroid::callback_ = NULL; | 14 DownloadRequestInfoBarDelegateAndroid::callback_ = NULL; |
| 16 | 15 |
| 17 DownloadRequestInfoBarDelegateAndroid:: | 16 DownloadRequestInfoBarDelegateAndroid:: |
| 18 ~DownloadRequestInfoBarDelegateAndroid() { | 17 ~DownloadRequestInfoBarDelegateAndroid() { |
| 19 if (!responded_ && host_) | 18 if (!responded_ && host_) |
| 20 host_->CancelOnce(); | 19 host_->CancelOnce(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 86 |
| 88 bool DownloadRequestInfoBarDelegateAndroid::Cancel() { | 87 bool DownloadRequestInfoBarDelegateAndroid::Cancel() { |
| 89 DCHECK(!responded_); | 88 DCHECK(!responded_); |
| 90 responded_ = true; | 89 responded_ = true; |
| 91 if (host_) { | 90 if (host_) { |
| 92 // This may invalidate |host_|. | 91 // This may invalidate |host_|. |
| 93 host_->Cancel(); | 92 host_->Cancel(); |
| 94 } | 93 } |
| 95 return !host_; | 94 return !host_; |
| 96 } | 95 } |
| OLD | NEW |