Index: chrome/browser/garbled_text_infobar_delegate.cc |
diff --git a/chrome/browser/garbled_text_infobar_delegate.cc b/chrome/browser/garbled_text_infobar_delegate.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8010eda14cdea5ebe16ceab9d6e6119728acc92e |
--- /dev/null |
+++ b/chrome/browser/garbled_text_infobar_delegate.cc |
@@ -0,0 +1,53 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/garbled_text_infobar_delegate.h" |
+ |
+#include "grit/generated_resources.h" |
+#include "ui/base/l10n/l10n_util.h" |
+ |
+GarbledTextInfoBarDelegate::GarbledTextInfoBarDelegate( |
+ InfoBarTabHelper* infobar_helper, |
+ const base::Closure& callback) |
+ : ConfirmInfoBarDelegate(infobar_helper), |
+ callback_(callback) { |
+} |
+ |
+GarbledTextInfoBarDelegate* |
+GarbledTextInfoBarDelegate::AsGarbledTextInfoBarDelegate() { |
+ return this; |
+} |
+ |
+GarbledTextInfoBarDelegate::~GarbledTextInfoBarDelegate() { |
+} |
+ |
+int GarbledTextInfoBarDelegate::GetButtons() const { |
+ return ConfirmInfoBarDelegate::BUTTON_OK; |
+} |
+ |
+string16 GarbledTextInfoBarDelegate::GetButtonLabel( |
+ InfoBarButton button) const { |
+ return l10n_util::GetStringUTF16(IDS_GARBLED_TEXT_INFOBAR_BUTTON_FIX); |
+} |
+ |
+string16 GarbledTextInfoBarDelegate::GetMessageText() const { |
+ return l10n_util::GetStringUTF16(IDS_GARBLED_TEXT_INFOBAR_PROMPT); |
+} |
+ |
+bool GarbledTextInfoBarDelegate::ShouldExpire( |
+ const content::LoadCommittedDetails&) const { |
+ return true; |
+} |
+ |
+void GarbledTextInfoBarDelegate::InfoBarDismissed() { |
+} |
+ |
+bool GarbledTextInfoBarDelegate::Accept() { |
+ callback_.Run(); |
+ return true; |
+} |
+ |
+bool GarbledTextInfoBarDelegate::Cancel() { |
+ return true; |
+} |