| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import <Cocoa/Cocoa.h> |
| 6 #import "chrome/browser/cocoa/infobar_controller.h" |
| 7 |
| 8 #include "base/scoped_nsobject.h" |
| 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/browser/translate/languages_menu_model.h" |
| 11 #include "chrome/browser/translate/options_menu_model.h" |
| 12 #include "chrome/common/notification_registrar.h" |
| 13 |
| 14 class TranslateInfoBarMenuModel; |
| 15 class TranslateNotificationObserverBridge; |
| 16 |
| 17 // Draws and maintains Translate Infobar GUI. |
| 18 // The translate bar changes unidirectionally between 3 states: |
| 19 // 1. "Before Translate" - source language popup and translate/cancel buttons |
| 20 // visible. |
| 21 // 2. "Translating" - "Translating..." status text visible in address bar. |
| 22 // 3. "After Translation" - source & target language popups visible. |
| 23 // |
| 24 // The GUI uses popup menus interspersed in a text label. For localization |
| 25 // purposes this means we potentially need 3 labels to display the UI (the 3rd |
| 26 // is only visible in certain locales). |
| 27 @interface TranslateInfoBarController : InfoBarController { |
| 28 @protected |
| 29 // label_ is defined in InfoBarController. |
| 30 scoped_nsobject<NSTextField> label2_; |
| 31 scoped_nsobject<NSTextField> label3_; |
| 32 scoped_nsobject<NSTextField> translatingLabel_; |
| 33 scoped_nsobject<NSPopUpButton> fromLanguagePopUp_; |
| 34 scoped_nsobject<NSPopUpButton> toLanguagePopUp_; |
| 35 scoped_nsobject<NSPopUpButton> optionsPopUp_; |
| 36 |
| 37 // In the current locale, are the "from" and "to" language popup menu |
| 38 // flipped from what they'd appear in English. |
| 39 bool swappedLanguagePlaceholders_; |
| 40 |
| 41 // Space between controls in pixels - read from the NIB. |
| 42 CGFloat spaceBetweenControls_; |
| 43 int numLabelsDisplayed_; |
| 44 |
| 45 scoped_ptr<LanguagesMenuModel> original_language_menu_model_; |
| 46 scoped_ptr<LanguagesMenuModel> target_language_menu_model_; |
| 47 scoped_ptr<OptionsMenuModel> options_menu_model_; |
| 48 scoped_ptr<TranslateInfoBarMenuModel> menu_model_; |
| 49 scoped_ptr<TranslateNotificationObserverBridge> observer_bridge_; |
| 50 } |
| 51 |
| 52 @end |
| OLD | NEW |