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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« 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