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/api/infobars/confirm_infobar_delegate.h" | 5 #include "chrome/browser/api/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 |
| 11 ConfirmInfoBarDelegate::~ConfirmInfoBarDelegate() { |
| 12 } |
| 13 |
11 InfoBarDelegate::InfoBarAutomationType | 14 InfoBarDelegate::InfoBarAutomationType |
12 ConfirmInfoBarDelegate::GetInfoBarAutomationType() const { | 15 ConfirmInfoBarDelegate::GetInfoBarAutomationType() const { |
13 return CONFIRM_INFOBAR; | 16 return CONFIRM_INFOBAR; |
14 } | 17 } |
15 | 18 |
16 int ConfirmInfoBarDelegate::GetButtons() const { | 19 int ConfirmInfoBarDelegate::GetButtons() const { |
17 return BUTTON_OK | BUTTON_CANCEL; | 20 return BUTTON_OK | BUTTON_CANCEL; |
18 } | 21 } |
19 | 22 |
20 string16 ConfirmInfoBarDelegate::GetButtonLabel(InfoBarButton button) const { | 23 string16 ConfirmInfoBarDelegate::GetButtonLabel(InfoBarButton button) const { |
(...skipping 18 matching lines...) Expand all Loading... |
39 | 42 |
40 bool ConfirmInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { | 43 bool ConfirmInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { |
41 return true; | 44 return true; |
42 } | 45 } |
43 | 46 |
44 ConfirmInfoBarDelegate::ConfirmInfoBarDelegate( | 47 ConfirmInfoBarDelegate::ConfirmInfoBarDelegate( |
45 InfoBarService* infobar_service) | 48 InfoBarService* infobar_service) |
46 : InfoBarDelegate(infobar_service) { | 49 : InfoBarDelegate(infobar_service) { |
47 } | 50 } |
48 | 51 |
49 ConfirmInfoBarDelegate::~ConfirmInfoBarDelegate() { | |
50 } | |
51 | |
52 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { | 52 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { |
53 ConfirmInfoBarDelegate* confirm_delegate = | 53 ConfirmInfoBarDelegate* confirm_delegate = |
54 delegate->AsConfirmInfoBarDelegate(); | 54 delegate->AsConfirmInfoBarDelegate(); |
55 return confirm_delegate && | 55 return confirm_delegate && |
56 (confirm_delegate->GetMessageText() == GetMessageText()); | 56 (confirm_delegate->GetMessageText() == GetMessageText()); |
57 } | 57 } |
58 | 58 |
59 bool ConfirmInfoBarDelegate::ShouldExpireInternal( | 59 bool ConfirmInfoBarDelegate::ShouldExpireInternal( |
60 const content::LoadCommittedDetails& details) const { | 60 const content::LoadCommittedDetails& details) const { |
61 return !details.did_replace_entry && | 61 return !details.did_replace_entry && |
62 InfoBarDelegate::ShouldExpireInternal(details); | 62 InfoBarDelegate::ShouldExpireInternal(details); |
63 } | 63 } |
64 | 64 |
65 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() { | 65 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() { |
66 return this; | 66 return this; |
67 } | 67 } |
OLD | NEW |