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 #include "chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.h
" | 5 #include "chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.h
" |
6 | 6 |
7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
8 #import "chrome/browser/ui/cocoa/infobars/infobar_utilities.h" | 8 #import "chrome/browser/ui/cocoa/infobars/infobar_utilities.h" |
9 #include "grit/components_strings.h" | 9 #include "grit/components_strings.h" |
10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 - (id)initWithInfoBar:(InfoBarCocoa*)infobar { | 40 - (id)initWithInfoBar:(InfoBarCocoa*)infobar { |
41 if ((self = [super initWithInfoBar:infobar])) { | 41 if ((self = [super initWithInfoBar:infobar])) { |
42 [self initializeExtraControls]; | 42 [self initializeExtraControls]; |
43 } | 43 } |
44 return self; | 44 return self; |
45 } | 45 } |
46 | 46 |
47 - (void)initializeExtraControls { | 47 - (void)initializeExtraControls { |
48 TranslateInfoBarDelegate* delegate = [self delegate]; | 48 translate::TranslateInfoBarDelegate* delegate = [self delegate]; |
49 const base::string16& language = | 49 const base::string16& language = |
50 delegate->language_name_at(delegate->original_language_index()); | 50 delegate->language_name_at(delegate->original_language_index()); |
51 neverTranslateButton_.reset( | 51 neverTranslateButton_.reset( |
52 CreateNSButtonWithResourceIDAndParameter( | 52 CreateNSButtonWithResourceIDAndParameter( |
53 IDS_TRANSLATE_INFOBAR_NEVER_TRANSLATE, language)); | 53 IDS_TRANSLATE_INFOBAR_NEVER_TRANSLATE, language)); |
54 [neverTranslateButton_ setTarget:self]; | 54 [neverTranslateButton_ setTarget:self]; |
55 [neverTranslateButton_ setAction:@selector(neverTranslate:)]; | 55 [neverTranslateButton_ setAction:@selector(neverTranslate:)]; |
56 | 56 |
57 alwaysTranslateButton_.reset( | 57 alwaysTranslateButton_.reset( |
58 CreateNSButtonWithResourceIDAndParameter( | 58 CreateNSButtonWithResourceIDAndParameter( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 @implementation BeforeTranslateInfobarController (TestingAPI) | 129 @implementation BeforeTranslateInfobarController (TestingAPI) |
130 | 130 |
131 - (NSButton*)alwaysTranslateButton { | 131 - (NSButton*)alwaysTranslateButton { |
132 return alwaysTranslateButton_.get(); | 132 return alwaysTranslateButton_.get(); |
133 } | 133 } |
134 - (NSButton*)neverTranslateButton { | 134 - (NSButton*)neverTranslateButton { |
135 return neverTranslateButton_.get(); | 135 return neverTranslateButton_.get(); |
136 } | 136 } |
137 | 137 |
138 @end | 138 @end |
OLD | NEW |