| 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 "components/infobars/core/confirm_infobar_delegate.h" | 5 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" |
| 8 #include "components/infobars/core/infobar.h" |
| 7 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 8 #include "ui/strings/grit/ui_strings.h" | 10 #include "ui/strings/grit/ui_strings.h" |
| 9 | 11 |
| 10 using infobars::InfoBarDelegate; | 12 using infobars::InfoBarDelegate; |
| 11 | 13 |
| 12 ConfirmInfoBarDelegate::~ConfirmInfoBarDelegate() { | 14 ConfirmInfoBarDelegate::~ConfirmInfoBarDelegate() { |
| 13 } | 15 } |
| 14 | 16 |
| 15 InfoBarDelegate::InfoBarAutomationType | 17 InfoBarDelegate::InfoBarAutomationType |
| 16 ConfirmInfoBarDelegate::GetInfoBarAutomationType() const { | 18 ConfirmInfoBarDelegate::GetInfoBarAutomationType() const { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 ConfirmInfoBarDelegate::ConfirmInfoBarDelegate() | 52 ConfirmInfoBarDelegate::ConfirmInfoBarDelegate() |
| 51 : InfoBarDelegate() { | 53 : InfoBarDelegate() { |
| 52 } | 54 } |
| 53 | 55 |
| 54 bool ConfirmInfoBarDelegate::ShouldExpireInternal( | 56 bool ConfirmInfoBarDelegate::ShouldExpireInternal( |
| 55 const NavigationDetails& details) const { | 57 const NavigationDetails& details) const { |
| 56 return !details.did_replace_entry && | 58 return !details.did_replace_entry && |
| 57 InfoBarDelegate::ShouldExpireInternal(details); | 59 InfoBarDelegate::ShouldExpireInternal(details); |
| 58 } | 60 } |
| 59 | 61 |
| 60 // ConfirmInfoBarDelegate::CreateInfoBar() is implemented in platform-specific | |
| 61 // files. | |
| 62 | |
| 63 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { | 62 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { |
| 64 ConfirmInfoBarDelegate* confirm_delegate = | 63 ConfirmInfoBarDelegate* confirm_delegate = |
| 65 delegate->AsConfirmInfoBarDelegate(); | 64 delegate->AsConfirmInfoBarDelegate(); |
| 66 return confirm_delegate && | 65 return confirm_delegate && |
| 67 (confirm_delegate->GetMessageText() == GetMessageText()); | 66 (confirm_delegate->GetMessageText() == GetMessageText()); |
| 68 } | 67 } |
| 69 | 68 |
| 70 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() { | 69 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() { |
| 71 return this; | 70 return this; |
| 72 } | 71 } |
| OLD | NEW |