| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_COCOA_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ | 6 #define CHROME_BROWSER_UI_COCOA_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #import "base/memory/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/translate/options_menu_model.h" | 12 #include "chrome/browser/translate/options_menu_model.h" |
| 13 #include "chrome/browser/translate/translate_infobar_delegate.h" | 13 #include "chrome/browser/translate/translate_infobar_delegate.h" |
| 14 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" | 14 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" |
| 15 #include "chrome/common/translate/translate_errors.h" | 15 #include "chrome/common/translate/translate_errors.h" |
| 16 | 16 |
| 17 // The base class for the three translate infobars. This class does all of the | 17 // The base class for the three translate infobars. This class does all of the |
| 18 // heavy UI lifting, while deferring to the subclass to tell it what views | 18 // heavy UI lifting, while deferring to the subclass to tell it what views |
| 19 // should be shown and where. Subclasses need to implement: | 19 // should be shown and where. Subclasses need to implement: |
| 20 // - (void)layout; | 20 // - (void)layout; |
| 21 // - (void)loadLabelText; | 21 // - (void)loadLabelText; |
| 22 // - (void)visibleControls; | 22 // - (void)visibleControls; |
| 23 // - (bool)verifyLayout; // For testing. | 23 // - (bool)verifyLayout; // For testing. |
| 24 @interface TranslateInfoBarControllerBase : InfoBarController<NSMenuDelegate> { | 24 @interface TranslateInfoBarControllerBase : InfoBarController<NSMenuDelegate> { |
| 25 @protected | 25 @protected |
| 26 scoped_nsobject<NSTextField> label1_; | 26 base::scoped_nsobject<NSTextField> label1_; |
| 27 scoped_nsobject<NSTextField> label2_; | 27 base::scoped_nsobject<NSTextField> label2_; |
| 28 scoped_nsobject<NSTextField> label3_; | 28 base::scoped_nsobject<NSTextField> label3_; |
| 29 scoped_nsobject<NSPopUpButton> fromLanguagePopUp_; | 29 base::scoped_nsobject<NSPopUpButton> fromLanguagePopUp_; |
| 30 scoped_nsobject<NSPopUpButton> toLanguagePopUp_; | 30 base::scoped_nsobject<NSPopUpButton> toLanguagePopUp_; |
| 31 scoped_nsobject<NSPopUpButton> optionsPopUp_; | 31 base::scoped_nsobject<NSPopUpButton> optionsPopUp_; |
| 32 scoped_nsobject<NSButton> showOriginalButton_; | 32 base::scoped_nsobject<NSButton> showOriginalButton_; |
| 33 // This is the button used in the translate message infobar. It can either be | 33 // This is the button used in the translate message infobar. It can either be |
| 34 // a "Try Again" button, or a "Show Original" button in the case that the | 34 // a "Try Again" button, or a "Show Original" button in the case that the |
| 35 // page was translated from an unknown language. | 35 // page was translated from an unknown language. |
| 36 scoped_nsobject<NSButton> translateMessageButton_; | 36 base::scoped_nsobject<NSButton> translateMessageButton_; |
| 37 | 37 |
| 38 // In the current locale, are the "from" and "to" language popup menu | 38 // In the current locale, are the "from" and "to" language popup menu |
| 39 // flipped from what they'd appear in English. | 39 // flipped from what they'd appear in English. |
| 40 bool swappedLanguagePlaceholders_; | 40 bool swappedLanguagePlaceholders_; |
| 41 | 41 |
| 42 // Space between controls in pixels - read from the NIB. | 42 // Space between controls in pixels - read from the NIB. |
| 43 CGFloat spaceBetweenControls_; | 43 CGFloat spaceBetweenControls_; |
| 44 | 44 |
| 45 scoped_ptr<OptionsMenuModel> optionsMenuModel_; | 45 scoped_ptr<OptionsMenuModel> optionsMenuModel_; |
| 46 } | 46 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 - (NSMenu*)optionsMenu; | 124 - (NSMenu*)optionsMenu; |
| 125 | 125 |
| 126 // Returns |translateMessageButton_|, see declaration of member | 126 // Returns |translateMessageButton_|, see declaration of member |
| 127 // variable for a full description. | 127 // variable for a full description. |
| 128 - (NSButton*)translateMessageButton; | 128 - (NSButton*)translateMessageButton; |
| 129 | 129 |
| 130 @end // TranslateInfoBarControllerBase (TestingAPI) | 130 @end // TranslateInfoBarControllerBase (TestingAPI) |
| 131 | 131 |
| 132 | 132 |
| 133 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ | 133 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ |
| OLD | NEW |