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 #ifndef CHROME_BROWSER_VIEWS_INFOBARS_TRANSLATE_INFOBARS_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_INFOBARS_TRANSLATE_INFOBARS_H_ |
6 #define CHROME_BROWSER_VIEWS_INFOBARS_TRANSLATE_INFOBARS_H_ | 6 #define CHROME_BROWSER_VIEWS_INFOBARS_TRANSLATE_INFOBARS_H_ |
7 | 7 |
8 #include "app/menus/simple_menu_model.h" | 8 #include "app/menus/simple_menu_model.h" |
9 #include "chrome/browser/translate/translate_infobars_delegates.h" | 9 #include "chrome/browser/translate/translate_infobars_delegates.h" |
10 #include "chrome/browser/views/infobars/infobars.h" | 10 #include "chrome/browser/views/infobars/infobars.h" |
11 #include "chrome/common/notification_registrar.h" | 11 #include "chrome/common/notification_registrar.h" |
12 #include "chrome/common/translate_errors.h" | 12 #include "chrome/common/translate_errors.h" |
13 #include "views/controls/menu/menu_2.h" | 13 #include "views/controls/menu/menu_2.h" |
14 #include "views/controls/menu/view_menu_delegate.h" | 14 #include "views/controls/menu/view_menu_delegate.h" |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 class ImageButton; | 17 class ImageButton; |
18 class ImageView; | 18 class ImageView; |
19 class Label; | 19 class Label; |
20 class MenuButton; | 20 class MenuButton; |
21 } | 21 } |
| 22 class InfoBarTextButton; |
22 class LanguagesMenuModel; | 23 class LanguagesMenuModel; |
23 class OptionsMenuModel; | 24 class OptionsMenuModel; |
24 class TranslateTextButton; | |
25 | 25 |
26 // This file contains implementations for infobars for the Translate feature. | 26 // This file contains implementations for infobars for the Translate feature. |
27 | 27 |
28 class TranslateInfoBar : public InfoBar, | 28 class TranslateInfoBar : public InfoBar, |
29 public views::ViewMenuDelegate, | 29 public views::ViewMenuDelegate, |
30 public menus::SimpleMenuModel::Delegate, | 30 public menus::SimpleMenuModel::Delegate, |
31 public NotificationObserver { | 31 public NotificationObserver { |
32 public: | 32 public: |
33 explicit TranslateInfoBar(TranslateInfoBarDelegate* delegate); | 33 explicit TranslateInfoBar(TranslateInfoBarDelegate* delegate); |
34 virtual ~TranslateInfoBar(); | 34 virtual ~TranslateInfoBar(); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 TranslateInfoBarDelegate::TranslateState state_; | 88 TranslateInfoBarDelegate::TranslateState state_; |
89 bool translation_pending_; | 89 bool translation_pending_; |
90 TranslateErrors::Type error_type_; | 90 TranslateErrors::Type error_type_; |
91 | 91 |
92 views::ImageView* icon_; | 92 views::ImageView* icon_; |
93 views::Label* label_1_; | 93 views::Label* label_1_; |
94 views::Label* label_2_; | 94 views::Label* label_2_; |
95 views::Label* label_3_; | 95 views::Label* label_3_; |
96 views::Label* translating_label_; | 96 views::Label* translating_label_; |
97 views::Label* error_label_; | 97 views::Label* error_label_; |
98 TranslateTextButton* accept_button_; | 98 InfoBarTextButton* accept_button_; |
99 TranslateTextButton* deny_button_; | 99 InfoBarTextButton* deny_button_; |
100 views::MenuButton* original_language_menu_button_; | 100 views::MenuButton* original_language_menu_button_; |
101 views::MenuButton* target_language_menu_button_; | 101 views::MenuButton* target_language_menu_button_; |
102 TranslateTextButton* revert_button_; | 102 InfoBarTextButton* revert_button_; |
103 views::MenuButton* options_menu_button_; | 103 views::MenuButton* options_menu_button_; |
104 TranslateTextButton* retry_button_; | 104 InfoBarTextButton* retry_button_; |
105 | 105 |
106 scoped_ptr<LanguagesMenuModel> original_language_menu_model_; | 106 scoped_ptr<LanguagesMenuModel> original_language_menu_model_; |
107 scoped_ptr<LanguagesMenuModel> target_language_menu_model_; | 107 scoped_ptr<LanguagesMenuModel> target_language_menu_model_; |
108 scoped_ptr<OptionsMenuModel> options_menu_model_; | 108 scoped_ptr<OptionsMenuModel> options_menu_model_; |
109 | 109 |
110 scoped_ptr<views::Menu2> original_language_menu_menu_; | 110 scoped_ptr<views::Menu2> original_language_menu_menu_; |
111 scoped_ptr<views::Menu2> target_language_menu_menu_; | 111 scoped_ptr<views::Menu2> target_language_menu_menu_; |
112 scoped_ptr<views::Menu2> options_menu_menu_; | 112 scoped_ptr<views::Menu2> options_menu_menu_; |
113 | 113 |
114 // This is true if language placeholders in label have been swapped. | 114 // This is true if language placeholders in label have been swapped. |
115 bool swapped_language_placeholders_; | 115 bool swapped_language_placeholders_; |
116 | 116 |
117 NotificationRegistrar notification_registrar_; | 117 NotificationRegistrar notification_registrar_; |
118 | 118 |
119 scoped_ptr<InfoBarBackground> normal_background_; | 119 scoped_ptr<InfoBarBackground> normal_background_; |
120 scoped_ptr<InfoBarBackground> error_background_; | 120 scoped_ptr<InfoBarBackground> error_background_; |
121 scoped_ptr<SlideAnimation> error_animation_; | 121 scoped_ptr<SlideAnimation> error_animation_; |
122 | 122 |
123 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBar); | 123 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBar); |
124 }; | 124 }; |
125 | 125 |
126 #endif // CHROME_BROWSER_VIEWS_INFOBARS_TRANSLATE_INFOBARS_H_ | 126 #endif // CHROME_BROWSER_VIEWS_INFOBARS_TRANSLATE_INFOBARS_H_ |
OLD | NEW |