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 : InfoBarDelegate() { | 48 InfoBarService* infobar_service) |
| 49 : InfoBarDelegate(infobar_service) { |
49 } | 50 } |
50 | 51 |
51 bool ConfirmInfoBarDelegate::ShouldExpireInternal( | 52 bool ConfirmInfoBarDelegate::ShouldExpireInternal( |
52 const content::LoadCommittedDetails& details) const { | 53 const content::LoadCommittedDetails& details) const { |
53 return !details.did_replace_entry && | 54 return !details.did_replace_entry && |
54 InfoBarDelegate::ShouldExpireInternal(details); | 55 InfoBarDelegate::ShouldExpireInternal(details); |
55 } | 56 } |
56 | 57 |
57 // ConfirmInfoBarDelegate::CreateInfoBar() is implemented in platform-specific | 58 // ConfirmInfoBarDelegate::CreateInfoBar() is implemented in platform-specific |
58 // files. | 59 // files. |
59 | 60 |
60 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { | 61 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { |
61 ConfirmInfoBarDelegate* confirm_delegate = | 62 ConfirmInfoBarDelegate* confirm_delegate = |
62 delegate->AsConfirmInfoBarDelegate(); | 63 delegate->AsConfirmInfoBarDelegate(); |
63 return confirm_delegate && | 64 return confirm_delegate && |
64 (confirm_delegate->GetMessageText() == GetMessageText()); | 65 (confirm_delegate->GetMessageText() == GetMessageText()); |
65 } | 66 } |
66 | 67 |
67 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() { | 68 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() { |
68 return this; | 69 return this; |
69 } | 70 } |
OLD | NEW |