| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/ui/settings/translate_collection_view_controller.h" | 5 #import "ios/chrome/browser/ui/settings/translate_collection_view_controller.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 _translationItem.get().text = | 100 _translationItem.get().text = |
| 101 l10n_util::GetNSString(IDS_IOS_TRANSLATE_SETTING); | 101 l10n_util::GetNSString(IDS_IOS_TRANSLATE_SETTING); |
| 102 _translationItem.get().on = [_translationEnabled value]; | 102 _translationItem.get().on = [_translationEnabled value]; |
| 103 [model addItem:_translationItem | 103 [model addItem:_translationItem |
| 104 toSectionWithIdentifier:SectionIdentifierTranslate]; | 104 toSectionWithIdentifier:SectionIdentifierTranslate]; |
| 105 | 105 |
| 106 CollectionViewTextItem* resetTranslate = [[[CollectionViewTextItem alloc] | 106 CollectionViewTextItem* resetTranslate = [[[CollectionViewTextItem alloc] |
| 107 initWithType:ItemTypeResetTranslate] autorelease]; | 107 initWithType:ItemTypeResetTranslate] autorelease]; |
| 108 resetTranslate.text = l10n_util::GetNSString(IDS_IOS_TRANSLATE_SETTING_RESET); | 108 resetTranslate.text = l10n_util::GetNSString(IDS_IOS_TRANSLATE_SETTING_RESET); |
| 109 resetTranslate.accessibilityTraits |= UIAccessibilityTraitButton; | 109 resetTranslate.accessibilityTraits |= UIAccessibilityTraitButton; |
| 110 resetTranslate.textFont = [MDCTypography body2Font]; | |
| 111 [model addItem:resetTranslate | 110 [model addItem:resetTranslate |
| 112 toSectionWithIdentifier:SectionIdentifierTranslate]; | 111 toSectionWithIdentifier:SectionIdentifierTranslate]; |
| 113 | 112 |
| 114 // Footer Section | 113 // Footer Section |
| 115 [model addSectionWithIdentifier:SectionIdentifierFooter]; | 114 [model addSectionWithIdentifier:SectionIdentifierFooter]; |
| 116 CollectionViewFooterItem* footer = [[[CollectionViewFooterItem alloc] | 115 CollectionViewFooterItem* footer = [[[CollectionViewFooterItem alloc] |
| 117 initWithType:ItemTypeFooter] autorelease]; | 116 initWithType:ItemTypeFooter] autorelease]; |
| 118 footer.text = l10n_util::GetNSString(IDS_IOS_TRANSLATE_SETTING_DESCRIPTION); | 117 footer.text = l10n_util::GetNSString(IDS_IOS_TRANSLATE_SETTING_DESCRIPTION); |
| 119 footer.linkURL = google_util::AppendGoogleLocaleParam( | 118 footer.linkURL = google_util::AppendGoogleLocaleParam( |
| 120 GURL(kTranslateLearnMoreUrl), | 119 GURL(kTranslateLearnMoreUrl), |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 base::mac::ObjCCastStrict<CollectionViewSwitchCell>( | 246 base::mac::ObjCCastStrict<CollectionViewSwitchCell>( |
| 248 [self.collectionView cellForItemAtIndexPath:switchPath]); | 247 [self.collectionView cellForItemAtIndexPath:switchPath]); |
| 249 | 248 |
| 250 DCHECK_EQ(switchCell.switchView, sender); | 249 DCHECK_EQ(switchCell.switchView, sender); |
| 251 BOOL isOn = switchCell.switchView.isOn; | 250 BOOL isOn = switchCell.switchView.isOn; |
| 252 switchItem.on = isOn; | 251 switchItem.on = isOn; |
| 253 [_translationEnabled setValue:isOn]; | 252 [_translationEnabled setValue:isOn]; |
| 254 } | 253 } |
| 255 | 254 |
| 256 @end | 255 @end |
| OLD | NEW |