summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-30 20:13:48 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-30 20:13:48 +0000
commit579317eee3c39cdb8d2f6bc082912757a5706c55 (patch)
tree915a295e4d930e7f52afcbfbc8d48b8de8ad93f0 /chrome/browser/gtk
parenta4aeaf46531bf14c25b93c0ded418c220bf222cb (diff)
downloadchromium_src-579317eee3c39cdb8d2f6bc082912757a5706c55.zip
chromium_src-579317eee3c39cdb8d2f6bc082912757a5706c55.tar.gz
chromium_src-579317eee3c39cdb8d2f6bc082912757a5706c55.tar.bz2
Adds support for language detection on the server side.
Relanding: http://codereview.chromium.org/2860037 The CLD can sometimes fail to detect the language of a page, in which case the translate server might be able to. This CL ensures the browser deals with the server side language detection properly. Also added a new factory method to create error translate infobar delegates that does not assert when the language code is incorrect. Also changed the enums in TranslateInfoBarDelegate2 to use the constant name style, as it is the preferred naming for enums according to the style guide. BUG=40857 TEST=Visit http://www.saanconf.org/saanday.htm, use the context menu to translate the page. You should get an error mentioning the page is already in English. Review URL: http://codereview.chromium.org/2854032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51288 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/translate/translate_infobar_base_gtk.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/chrome/browser/gtk/translate/translate_infobar_base_gtk.cc b/chrome/browser/gtk/translate/translate_infobar_base_gtk.cc
index a2d46e0..80ee803 100644
--- a/chrome/browser/gtk/translate/translate_infobar_base_gtk.cc
+++ b/chrome/browser/gtk/translate/translate_infobar_base_gtk.cc
@@ -36,14 +36,14 @@ TranslateInfoBarBase::TranslateInfoBarBase(TranslateInfoBarDelegate2* delegate)
: InfoBar(delegate) {
TranslateInfoBarDelegate2::BackgroundAnimationType animation =
delegate->background_animation_type();
- if (animation != TranslateInfoBarDelegate2::NONE) {
+ if (animation != TranslateInfoBarDelegate2::kNone) {
background_color_animation_.reset(new SlideAnimation(this));
background_color_animation_->SetTweenType(Tween::LINEAR);
background_color_animation_->SetSlideDuration(500);
- if (animation == TranslateInfoBarDelegate2::NORMAL_TO_ERROR) {
+ if (animation == TranslateInfoBarDelegate2::kNormalToError) {
background_color_animation_->Show();
} else {
- DCHECK_EQ(TranslateInfoBarDelegate2::ERROR_TO_NORMAL, animation);
+ DCHECK_EQ(TranslateInfoBarDelegate2::kErrorToNormal, animation);
// Hide() runs the animation in reverse.
background_color_animation_->Reset(1.0);
background_color_animation_->Hide();
@@ -216,14 +216,14 @@ void TranslateInfoBarBase::OnOptionsClicked(GtkWidget* sender) {
InfoBar* TranslateInfoBarDelegate2::CreateInfoBar() {
TranslateInfoBarBase* infobar = NULL;
switch (type_) {
- case BEFORE_TRANSLATE:
+ case kBeforeTranslate:
infobar = new BeforeTranslateInfoBar(this);
break;
- case AFTER_TRANSLATE:
+ case kAfterTranslate:
infobar = new AfterTranslateInfoBar(this);
break;
- case TRANSLATING:
- case TRANSLATION_ERROR:
+ case kTranslating:
+ case kTranslationError:
infobar = new TranslateMessageInfoBar(this);
break;
default: