| 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/infobars/confirm_infobar_delegate.h" | 5 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "content/public/browser/navigation_details.h" | 7 #include "content/public/browser/navigation_details.h" |
| 8 #include "grit/generated_resources.h" | 8 #include "grit/generated_resources.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 string16 ConfirmInfoBarDelegate::GetLinkText() const { | 39 string16 ConfirmInfoBarDelegate::GetLinkText() const { |
| 40 return string16(); | 40 return string16(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 bool ConfirmInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { | 43 bool ConfirmInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { |
| 44 return true; | 44 return true; |
| 45 } | 45 } |
| 46 | 46 |
| 47 ConfirmInfoBarDelegate::ConfirmInfoBarDelegate( | 47 ConfirmInfoBarDelegate::ConfirmInfoBarDelegate() |
| 48 InfoBarService* infobar_service) | 48 : InfoBarDelegate() { |
| 49 : InfoBarDelegate(infobar_service) { | |
| 50 } | 49 } |
| 51 | 50 |
| 52 bool ConfirmInfoBarDelegate::ShouldExpireInternal( | 51 bool ConfirmInfoBarDelegate::ShouldExpireInternal( |
| 53 const content::LoadCommittedDetails& details) const { | 52 const content::LoadCommittedDetails& details) const { |
| 54 return !details.did_replace_entry && | 53 return !details.did_replace_entry && |
| 55 InfoBarDelegate::ShouldExpireInternal(details); | 54 InfoBarDelegate::ShouldExpireInternal(details); |
| 56 } | 55 } |
| 57 | 56 |
| 58 // ConfirmInfoBarDelegate::CreateInfoBar() is implemented in platform-specific | 57 // ConfirmInfoBarDelegate::CreateInfoBar() is implemented in platform-specific |
| 59 // files. | 58 // files. |
| 60 | 59 |
| 61 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { | 60 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { |
| 62 ConfirmInfoBarDelegate* confirm_delegate = | 61 ConfirmInfoBarDelegate* confirm_delegate = |
| 63 delegate->AsConfirmInfoBarDelegate(); | 62 delegate->AsConfirmInfoBarDelegate(); |
| 64 return confirm_delegate && | 63 return confirm_delegate && |
| 65 (confirm_delegate->GetMessageText() == GetMessageText()); | 64 (confirm_delegate->GetMessageText() == GetMessageText()); |
| 66 } | 65 } |
| 67 | 66 |
| 68 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() { | 67 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() { |
| 69 return this; | 68 return this; |
| 70 } | 69 } |
| OLD | NEW |