Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1375)

Unified Diff: chrome/browser/garbled_text_infobar_delegate.cc

Issue 9235004: [Garbled Text][Infobar] Adding infobar to suggest turning on encoding detection. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/garbled_text_infobar_delegate.h ('k') | chrome/browser/garbled_text_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
« no previous file with comments | « chrome/browser/garbled_text_infobar_delegate.h ('k') | chrome/browser/garbled_text_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698