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 #import "chrome/browser/ui/cocoa/infobars/translate_infobar_base.h" | 5 #import "chrome/browser/ui/cocoa/infobars/translate_infobar_base.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/translate/translate_infobar_delegate.h" | 10 #include "chrome/browser/translate/translate_infobar_delegate.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 i != [self delegate]->target_language_index(), | 262 i != [self delegate]->target_language_index(), |
263 i == [self delegate]->original_language_index()); | 263 i == [self delegate]->original_language_index()); |
264 AddMenuItem(targetLanguageMenu, | 264 AddMenuItem(targetLanguageMenu, |
265 self, | 265 self, |
266 @selector(languageMenuChanged:), | 266 @selector(languageMenuChanged:), |
267 title, | 267 title, |
268 IDC_TRANSLATE_TARGET_LANGUAGE_BASE + i, | 268 IDC_TRANSLATE_TARGET_LANGUAGE_BASE + i, |
269 i != [self delegate]->original_language_index(), | 269 i != [self delegate]->original_language_index(), |
270 i == [self delegate]->target_language_index()); | 270 i == [self delegate]->target_language_index()); |
271 } | 271 } |
272 [fromLanguagePopUp_ | 272 if ([self delegate]->original_language_index() != |
273 selectItemAtIndex:([self delegate]->original_language_index())]; | 273 TranslateInfoBarDelegate::kNoIndex) { |
| 274 [fromLanguagePopUp_ |
| 275 selectItemAtIndex:([self delegate]->original_language_index())]; |
| 276 } |
274 [toLanguagePopUp_ | 277 [toLanguagePopUp_ |
275 selectItemAtIndex:([self delegate]->target_language_index())]; | 278 selectItemAtIndex:([self delegate]->target_language_index())]; |
276 } | 279 } |
277 | 280 |
278 - (void)addAdditionalControls { | 281 - (void)addAdditionalControls { |
279 using l10n_util::GetNSString; | 282 using l10n_util::GetNSString; |
280 using l10n_util::GetNSStringWithFixup; | 283 using l10n_util::GetNSStringWithFixup; |
281 | 284 |
282 // Get layout information from the NIB. | 285 // Get layout information from the NIB. |
283 NSRect okButtonFrame = [okButton_ frame]; | 286 NSRect okButtonFrame = [okButton_ frame]; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 [[control description] UTF8String] <<[title UTF8String]; | 543 [[control description] UTF8String] <<[title UTF8String]; |
541 return false; | 544 return false; |
542 } | 545 } |
543 previousControl = control; | 546 previousControl = control; |
544 } | 547 } |
545 | 548 |
546 return true; | 549 return true; |
547 } | 550 } |
548 | 551 |
549 @end // TranslateInfoBarControllerBase (TestingAPI) | 552 @end // TranslateInfoBarControllerBase (TestingAPI) |
OLD | NEW |