Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Side by Side Diff: ios/chrome/browser/ui/settings/dataplan_usage_collection_view_controller.mm

Issue 2761263003: Allow CollectionViewModel/Controller queries without SectionIdentifier (Closed)
Patch Set: Cleanup Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/dataplan_usage_collection_view_controlle r.h" 5 #import "ios/chrome/browser/ui/settings/dataplan_usage_collection_view_controlle r.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/foundation_util.h" 8 #import "base/mac/foundation_util.h"
9 #include "components/prefs/pref_member.h" 9 #include "components/prefs/pref_member.h"
10 #include "components/prefs/pref_service.h" 10 #include "components/prefs/pref_service.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 MDCCollectionViewCellAccessoryType desiredType = 115 MDCCollectionViewCellAccessoryType desiredType =
116 value->second ? MDCCollectionViewCellAccessoryCheckmark 116 value->second ? MDCCollectionViewCellAccessoryCheckmark
117 : MDCCollectionViewCellAccessoryNone; 117 : MDCCollectionViewCellAccessoryNone;
118 if (item.accessoryType != desiredType) { 118 if (item.accessoryType != desiredType) {
119 item.accessoryType = desiredType; 119 item.accessoryType = desiredType;
120 [modifiedItems addObject:item]; 120 [modifiedItems addObject:item];
121 } 121 }
122 } 122 }
123 123
124 [self reconfigureCellsForItems:modifiedItems 124 [self reconfigureCellsForItems:modifiedItems];
125 inSectionWithIdentifier:SectionIdentifierOptions];
126 } 125 }
127 126
128 - (void)updateBasePref:(BOOL)basePref wifiPref:(BOOL)wifiPref { 127 - (void)updateBasePref:(BOOL)basePref wifiPref:(BOOL)wifiPref {
129 basePreference_.SetValue(basePref); 128 basePreference_.SetValue(basePref);
130 wifiPreference_.SetValue(wifiPref); 129 wifiPreference_.SetValue(wifiPref);
131 [self updateCheckedState]; 130 [self updateCheckedState];
132 } 131 }
133 132
134 #pragma mark - Internal methods 133 #pragma mark - Internal methods
135 134
(...skipping 25 matching lines...) Expand all
161 case ItemTypeOptionsOnlyOnWiFi: 160 case ItemTypeOptionsOnlyOnWiFi:
162 [self updateBasePref:YES wifiPref:YES]; 161 [self updateBasePref:YES wifiPref:YES];
163 break; 162 break;
164 case ItemTypeOptionsNever: 163 case ItemTypeOptionsNever:
165 [self updateBasePref:NO wifiPref:NO]; 164 [self updateBasePref:NO wifiPref:NO];
166 break; 165 break;
167 } 166 }
168 } 167 }
169 168
170 @end 169 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698