summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/translate
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-30 16:59:03 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-30 16:59:03 +0000
commit7838c2502799cbfe33ba16575b0e7d0b03740dd1 (patch)
tree17e926b6917b11264605ca01c7c9c1bfb3125d55 /chrome/browser/gtk/translate
parent5179b0eb8c7f0399157d747f8bce1838cdeb89d7 (diff)
downloadchromium_src-7838c2502799cbfe33ba16575b0e7d0b03740dd1.zip
chromium_src-7838c2502799cbfe33ba16575b0e7d0b03740dd1.tar.gz
chromium_src-7838c2502799cbfe33ba16575b0e7d0b03740dd1.tar.bz2
Revert 51263 (breaks the Linux views build)
Adds support for language detection on the server side. 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. Original review: http://codereview.chromium.org/2859013/show 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/2860037 TBR=jcivelli@chromium.org Review URL: http://codereview.chromium.org/2873035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51265 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/translate')
-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 80ee803..a2d46e0 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::kNone) {
+ if (animation != TranslateInfoBarDelegate2::NONE) {
background_color_animation_.reset(new SlideAnimation(this));
background_color_animation_->SetTweenType(Tween::LINEAR);
background_color_animation_->SetSlideDuration(500);
- if (animation == TranslateInfoBarDelegate2::kNormalToError) {
+ if (animation == TranslateInfoBarDelegate2::NORMAL_TO_ERROR) {
background_color_animation_->Show();
} else {
- DCHECK_EQ(TranslateInfoBarDelegate2::kErrorToNormal, animation);
+ DCHECK_EQ(TranslateInfoBarDelegate2::ERROR_TO_NORMAL, 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 kBeforeTranslate:
+ case BEFORE_TRANSLATE:
infobar = new BeforeTranslateInfoBar(this);
break;
- case kAfterTranslate:
+ case AFTER_TRANSLATE:
infobar = new AfterTranslateInfoBar(this);
break;
- case kTranslating:
- case kTranslationError:
+ case TRANSLATING:
+ case TRANSLATION_ERROR:
infobar = new TranslateMessageInfoBar(this);
break;
default: