| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/translate/translate_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/translate/translate_bubble_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 items_.push_back(l10n_util::GetStringFUTF16( | 39 items_.push_back(l10n_util::GetStringFUTF16( |
| 40 IDS_TRANSLATE_BUBBLE_NEVER_TRANSLATE_LANG, | 40 IDS_TRANSLATE_BUBBLE_NEVER_TRANSLATE_LANG, |
| 41 original_language_name)); | 41 original_language_name)); |
| 42 items_.push_back(l10n_util::GetStringUTF16( | 42 items_.push_back(l10n_util::GetStringUTF16( |
| 43 IDS_TRANSLATE_BUBBLE_NEVER_TRANSLATE_SITE)); | 43 IDS_TRANSLATE_BUBBLE_NEVER_TRANSLATE_SITE)); |
| 44 } | 44 } |
| 45 virtual ~TranslateDenialComboboxModel() {} | 45 virtual ~TranslateDenialComboboxModel() {} |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 // ComboboxModel: | 48 // ComboboxModel: |
| 49 virtual int GetItemCount() const OVERRIDE { | 49 virtual int GetItemCount() const override { |
| 50 return items_.size(); | 50 return items_.size(); |
| 51 } | 51 } |
| 52 virtual base::string16 GetItemAt(int index) OVERRIDE { | 52 virtual base::string16 GetItemAt(int index) override { |
| 53 return items_[index]; | 53 return items_[index]; |
| 54 } | 54 } |
| 55 virtual bool IsItemSeparatorAt(int index) OVERRIDE { | 55 virtual bool IsItemSeparatorAt(int index) override { |
| 56 return false; | 56 return false; |
| 57 } | 57 } |
| 58 virtual int GetDefaultIndex() const OVERRIDE { | 58 virtual int GetDefaultIndex() const override { |
| 59 return 0; | 59 return 0; |
| 60 } | 60 } |
| 61 | 61 |
| 62 std::vector<base::string16> items_; | 62 std::vector<base::string16> items_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(TranslateDenialComboboxModel); | 64 DISALLOW_COPY_AND_ASSIGN(TranslateDenialComboboxModel); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 const CGFloat kWindowWidth = 320; | 67 const CGFloat kWindowWidth = 320; |
| 68 | 68 |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 [self updateAdvancedView]; | 646 [self updateAdvancedView]; |
| 647 } | 647 } |
| 648 | 648 |
| 649 - (void)handleTargetLanguagePopUpButtonSelectedItemChanged:(id)sender { | 649 - (void)handleTargetLanguagePopUpButtonSelectedItemChanged:(id)sender { |
| 650 NSPopUpButton* button = base::mac::ObjCCastStrict<NSPopUpButton>(sender); | 650 NSPopUpButton* button = base::mac::ObjCCastStrict<NSPopUpButton>(sender); |
| 651 model_->UpdateTargetLanguageIndex([button indexOfSelectedItem]); | 651 model_->UpdateTargetLanguageIndex([button indexOfSelectedItem]); |
| 652 [self updateAdvancedView]; | 652 [self updateAdvancedView]; |
| 653 } | 653 } |
| 654 | 654 |
| 655 @end | 655 @end |
| OLD | NEW |