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 #include <memory> |
| 11 |
10 #import "base/mac/scoped_nsobject.h" | 12 #import "base/mac/scoped_nsobject.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" | 13 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" |
13 #include "components/translate/core/browser/options_menu_model.h" | 14 #include "components/translate/core/browser/options_menu_model.h" |
14 #include "components/translate/core/browser/translate_infobar_delegate.h" | 15 #include "components/translate/core/browser/translate_infobar_delegate.h" |
15 #include "components/translate/core/common/translate_errors.h" | 16 #include "components/translate/core/common/translate_errors.h" |
16 | 17 |
17 // The base class for the three translate infobars. This class does all of the | 18 // 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 | 19 // heavy UI lifting, while deferring to the subclass to tell it what views |
19 // should be shown and where. Subclasses need to implement: | 20 // should be shown and where. Subclasses need to implement: |
20 // - (void)layout; | 21 // - (void)layout; |
21 // - (void)loadLabelText; | 22 // - (void)loadLabelText; |
(...skipping 13 matching lines...) Expand all Loading... |
35 // page was translated from an unknown language. | 36 // page was translated from an unknown language. |
36 base::scoped_nsobject<NSButton> translateMessageButton_; | 37 base::scoped_nsobject<NSButton> translateMessageButton_; |
37 | 38 |
38 // In the current locale, are the "from" and "to" language popup menu | 39 // In the current locale, are the "from" and "to" language popup menu |
39 // flipped from what they'd appear in English. | 40 // flipped from what they'd appear in English. |
40 bool swappedLanguagePlaceholders_; | 41 bool swappedLanguagePlaceholders_; |
41 | 42 |
42 // Space between controls in pixels - read from the NIB. | 43 // Space between controls in pixels - read from the NIB. |
43 CGFloat spaceBetweenControls_; | 44 CGFloat spaceBetweenControls_; |
44 | 45 |
45 scoped_ptr<translate::OptionsMenuModel> optionsMenuModel_; | 46 std::unique_ptr<translate::OptionsMenuModel> optionsMenuModel_; |
46 } | 47 } |
47 | 48 |
48 // Returns the delegate as a TranslateInfoBarDelegate. The return | 49 // Returns the delegate as a TranslateInfoBarDelegate. The return |
49 // value can be NULL if the infobar is closing. | 50 // value can be NULL if the infobar is closing. |
50 - (translate::TranslateInfoBarDelegate*)delegate; | 51 - (translate::TranslateInfoBarDelegate*)delegate; |
51 | 52 |
52 // Called when the "Show Original" button is pressed. | 53 // Called when the "Show Original" button is pressed. |
53 - (IBAction)showOriginal:(id)sender; | 54 - (IBAction)showOriginal:(id)sender; |
54 | 55 |
55 @end | 56 @end |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 - (NSMenu*)optionsMenu; | 128 - (NSMenu*)optionsMenu; |
128 | 129 |
129 // Returns |translateMessageButton_|, see declaration of member | 130 // Returns |translateMessageButton_|, see declaration of member |
130 // variable for a full description. | 131 // variable for a full description. |
131 - (NSButton*)translateMessageButton; | 132 - (NSButton*)translateMessageButton; |
132 | 133 |
133 @end // TranslateInfoBarControllerBase (TestingAPI) | 134 @end // TranslateInfoBarControllerBase (TestingAPI) |
134 | 135 |
135 | 136 |
136 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ | 137 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ |
OLD | NEW |