Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: chrome/browser/ui/cocoa/infobars/translate_infobar_base.h

Issue 10952016: Simplify the translate infobar code some. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/memory/scoped_nsobject.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/translate/languages_menu_model.h"
13 #include "chrome/browser/translate/options_menu_model.h" 12 #include "chrome/browser/translate/options_menu_model.h"
14 #include "chrome/browser/translate/translate_infobar_delegate.h" 13 #include "chrome/browser/translate/translate_infobar_delegate.h"
15 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" 14 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h"
16 #include "chrome/common/translate_errors.h" 15 #include "chrome/common/translate_errors.h"
17 16
18 // 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
19 // 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
20 // should be shown and where. Subclasses need to implement: 19 // should be shown and where. Subclasses need to implement:
21 // - (void)layout; 20 // - (void)layout;
22 // - (void)loadLabelText; 21 // - (void)loadLabelText;
(...skipping 13 matching lines...) Expand all
36 // page was translated from an unknown language. 35 // page was translated from an unknown language.
37 scoped_nsobject<NSButton> translateMessageButton_; 36 scoped_nsobject<NSButton> translateMessageButton_;
38 37
39 // 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
40 // flipped from what they'd appear in English. 39 // flipped from what they'd appear in English.
41 bool swappedLanguagePlaceholders_; 40 bool swappedLanguagePlaceholders_;
42 41
43 // Space between controls in pixels - read from the NIB. 42 // Space between controls in pixels - read from the NIB.
44 CGFloat spaceBetweenControls_; 43 CGFloat spaceBetweenControls_;
45 44
46 scoped_ptr<LanguagesMenuModel> originalLanguageMenuModel_;
47 scoped_ptr<LanguagesMenuModel> targetLanguageMenuModel_;
48 scoped_ptr<OptionsMenuModel> optionsMenuModel_; 45 scoped_ptr<OptionsMenuModel> optionsMenuModel_;
49 } 46 }
50 47
51 // Returns the delegate as a TranslateInfoBarDelegate. The return 48 // Returns the delegate as a TranslateInfoBarDelegate. The return
52 // value can be NULL if the infobar is closing. 49 // value can be NULL if the infobar is closing.
53 - (TranslateInfoBarDelegate*)delegate; 50 - (TranslateInfoBarDelegate*)delegate;
54 51
55 // Called when the "Show Original" button is pressed. 52 // Called when the "Show Original" button is pressed.
56 - (IBAction)showOriginal:(id)sender; 53 - (IBAction)showOriginal:(id)sender;
57 54
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 - (NSMenu*)optionsMenu; 124 - (NSMenu*)optionsMenu;
128 125
129 // Returns |translateMessageButton_|, see declaration of member 126 // Returns |translateMessageButton_|, see declaration of member
130 // variable for a full description. 127 // variable for a full description.
131 - (NSButton*)translateMessageButton; 128 - (NSButton*)translateMessageButton;
132 129
133 @end // TranslateInfoBarControllerBase (TestingAPI) 130 @end // TranslateInfoBarControllerBase (TestingAPI)
134 131
135 132
136 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ 133 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_TRANSLATE_INFOBAR_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698