| 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" |
| 11 #include "base/mac/scoped_nsobject.h" |
| 11 #include "components/google/core/browser/google_util.h" | 12 #include "components/google/core/browser/google_util.h" |
| 12 #include "components/prefs/pref_member.h" | 13 #include "components/prefs/pref_member.h" |
| 13 #include "components/prefs/pref_service.h" | 14 #include "components/prefs/pref_service.h" |
| 14 #include "components/translate/core/browser/translate_prefs.h" | 15 #include "components/translate/core/browser/translate_prefs.h" |
| 15 #include "components/translate/core/common/translate_pref_names.h" | 16 #include "components/translate/core/common/translate_pref_names.h" |
| 16 #include "ios/chrome/browser/application_context.h" | 17 #include "ios/chrome/browser/application_context.h" |
| 17 #import "ios/chrome/browser/translate/chrome_ios_translate_client.h" | 18 #import "ios/chrome/browser/translate/chrome_ios_translate_client.h" |
| 18 #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrom
e.h" | 19 #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrom
e.h" |
| 19 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_footer_item
.h" | 20 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_footer_item
.h" |
| 20 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_switch_item
.h" | 21 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_switch_item
.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 base::mac::ObjCCastStrict<CollectionViewSwitchCell>( | 251 base::mac::ObjCCastStrict<CollectionViewSwitchCell>( |
| 251 [self.collectionView cellForItemAtIndexPath:switchPath]); | 252 [self.collectionView cellForItemAtIndexPath:switchPath]); |
| 252 | 253 |
| 253 DCHECK_EQ(switchCell.switchView, sender); | 254 DCHECK_EQ(switchCell.switchView, sender); |
| 254 BOOL isOn = switchCell.switchView.isOn; | 255 BOOL isOn = switchCell.switchView.isOn; |
| 255 switchItem.on = isOn; | 256 switchItem.on = isOn; |
| 256 [_translationEnabled setValue:isOn]; | 257 [_translationEnabled setValue:isOn]; |
| 257 } | 258 } |
| 258 | 259 |
| 259 @end | 260 @end |
| OLD | NEW |