[safe-browsing] Database full hash matches like prefix match.
[chromium-blink-merge.git] / chrome / browser / infobars / confirm_infobar_delegate.cc
blob51f87028da1af3119da01f46c648f0d0057d6246
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
3 // found in the LICENSE file.
5 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
7 #include "grit/generated_resources.h"
8 #include "ui/base/l10n/l10n_util.h"
10 using infobars::InfoBarDelegate;
12 ConfirmInfoBarDelegate::~ConfirmInfoBarDelegate() {
15 InfoBarDelegate::InfoBarAutomationType
16 ConfirmInfoBarDelegate::GetInfoBarAutomationType() const {
17 return CONFIRM_INFOBAR;
20 int ConfirmInfoBarDelegate::GetButtons() const {
21 return BUTTON_OK | BUTTON_CANCEL;
24 base::string16 ConfirmInfoBarDelegate::GetButtonLabel(
25 InfoBarButton button) const {
26 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_OK : IDS_CANCEL);
29 bool ConfirmInfoBarDelegate::OKButtonTriggersUACPrompt() const {
30 return false;
33 bool ConfirmInfoBarDelegate::Accept() {
34 return true;
37 bool ConfirmInfoBarDelegate::Cancel() {
38 return true;
41 base::string16 ConfirmInfoBarDelegate::GetLinkText() const {
42 return base::string16();
45 bool ConfirmInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
46 return true;
49 ConfirmInfoBarDelegate::ConfirmInfoBarDelegate()
50 : InfoBarDelegate() {
53 bool ConfirmInfoBarDelegate::ShouldExpireInternal(
54 const NavigationDetails& details) const {
55 return !details.did_replace_entry &&
56 InfoBarDelegate::ShouldExpireInternal(details);
59 // ConfirmInfoBarDelegate::CreateInfoBar() is implemented in platform-specific
60 // files.
62 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
63 ConfirmInfoBarDelegate* confirm_delegate =
64 delegate->AsConfirmInfoBarDelegate();
65 return confirm_delegate &&
66 (confirm_delegate->GetMessageText() == GetMessageText());
69 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() {
70 return this;