OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "chrome/browser/garbled_text_infobar_delegate.h" |
| 6 |
| 7 #include "grit/generated_resources.h" |
| 8 #include "ui/base/l10n/l10n_util.h" |
| 9 |
| 10 GarbledTextInfoBarDelegate::GarbledTextInfoBarDelegate( |
| 11 InfoBarTabHelper* infobar_helper, |
| 12 const base::Closure& callback) |
| 13 : ConfirmInfoBarDelegate(infobar_helper), |
| 14 callback_(callback) { |
| 15 } |
| 16 |
| 17 GarbledTextInfoBarDelegate* |
| 18 GarbledTextInfoBarDelegate::AsGarbledTextInfoBarDelegate() { |
| 19 return this; |
| 20 } |
| 21 |
| 22 GarbledTextInfoBarDelegate::~GarbledTextInfoBarDelegate() { |
| 23 } |
| 24 |
| 25 int GarbledTextInfoBarDelegate::GetButtons() const { |
| 26 return ConfirmInfoBarDelegate::BUTTON_OK; |
| 27 } |
| 28 |
| 29 string16 GarbledTextInfoBarDelegate::GetButtonLabel( |
| 30 InfoBarButton button) const { |
| 31 return l10n_util::GetStringUTF16(IDS_GARBLED_TEXT_INFOBAR_BUTTON_FIX); |
| 32 } |
| 33 |
| 34 string16 GarbledTextInfoBarDelegate::GetMessageText() const { |
| 35 return l10n_util::GetStringUTF16(IDS_GARBLED_TEXT_INFOBAR_PROMPT); |
| 36 } |
| 37 |
| 38 bool GarbledTextInfoBarDelegate::ShouldExpire( |
| 39 const content::LoadCommittedDetails&) const { |
| 40 return true; |
| 41 } |
| 42 |
| 43 void GarbledTextInfoBarDelegate::InfoBarDismissed() { |
| 44 } |
| 45 |
| 46 bool GarbledTextInfoBarDelegate::Accept() { |
| 47 callback_.Run(); |
| 48 return true; |
| 49 } |
| 50 |
| 51 bool GarbledTextInfoBarDelegate::Cancel() { |
| 52 return true; |
| 53 } |
OLD | NEW |