| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/gtk/translate_infobars.h" | 5 #include "chrome/browser/gtk/translate_infobars.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } // namespace | 142 } // namespace |
| 143 | 143 |
| 144 TranslateInfoBar::TranslateInfoBar(TranslateInfoBarDelegate* delegate) | 144 TranslateInfoBar::TranslateInfoBar(TranslateInfoBarDelegate* delegate) |
| 145 : InfoBar(delegate), | 145 : InfoBar(delegate), |
| 146 background_error_percent_(0), | 146 background_error_percent_(0), |
| 147 state_(TranslateInfoBarDelegate::kTranslateNone), | 147 state_(TranslateInfoBarDelegate::kTranslateNone), |
| 148 translation_pending_(false), | 148 translation_pending_(false), |
| 149 swapped_language_placeholders_(false) { | 149 swapped_language_placeholders_(false) { |
| 150 // Initialize slide animation for transitioning to and from error state. | 150 // Initialize slide animation for transitioning to and from error state. |
| 151 error_animation_.reset(new SlideAnimation(this)); | 151 error_animation_.reset(new SlideAnimation(this)); |
| 152 error_animation_->SetTweenType(SlideAnimation::NONE); | 152 error_animation_->SetTweenType(Tween::LINEAR); |
| 153 error_animation_->SetSlideDuration(500); | 153 error_animation_->SetSlideDuration(500); |
| 154 | 154 |
| 155 BuildWidgets(); | 155 BuildWidgets(); |
| 156 | 156 |
| 157 // Register for PAGE_TRANSLATED notification. | 157 // Register for PAGE_TRANSLATED notification. |
| 158 notification_registrar_.Add(this, NotificationType::PAGE_TRANSLATED, | 158 notification_registrar_.Add(this, NotificationType::PAGE_TRANSLATED, |
| 159 Source<TabContents>(GetDelegate()->tab_contents())); | 159 Source<TabContents>(GetDelegate()->tab_contents())); |
| 160 } | 160 } |
| 161 | 161 |
| 162 TranslateInfoBar::~TranslateInfoBar() { | 162 TranslateInfoBar::~TranslateInfoBar() { |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 options_menu_menu_.reset(new MenuGtk(this, options_menu_model_.get())); | 575 options_menu_menu_.reset(new MenuGtk(this, options_menu_model_.get())); |
| 576 } | 576 } |
| 577 options_menu_menu_->Popup(sender, 1, gtk_get_current_event_time()); | 577 options_menu_menu_->Popup(sender, 1, gtk_get_current_event_time()); |
| 578 } | 578 } |
| 579 | 579 |
| 580 // TranslateInfoBarDelegate, InfoBarDelegate overrides: ------------------ | 580 // TranslateInfoBarDelegate, InfoBarDelegate overrides: ------------------ |
| 581 | 581 |
| 582 InfoBar* TranslateInfoBarDelegate::CreateInfoBar() { | 582 InfoBar* TranslateInfoBarDelegate::CreateInfoBar() { |
| 583 return new TranslateInfoBar(this); | 583 return new TranslateInfoBar(this); |
| 584 } | 584 } |
| OLD | NEW |