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

Side by Side Diff: ios/chrome/browser/ui/settings/block_popups_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/block_popups_collection_view_controller. h" 5 #import "ios/chrome/browser/ui/settings/block_popups_collection_view_controller. 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 "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 #pragma mark - BooleanObserver 221 #pragma mark - BooleanObserver
222 222
223 - (void)booleanDidChange:(id<ObservableBoolean>)observableBoolean { 223 - (void)booleanDidChange:(id<ObservableBoolean>)observableBoolean {
224 DCHECK_EQ(observableBoolean, _disablePopupsSetting); 224 DCHECK_EQ(observableBoolean, _disablePopupsSetting);
225 225
226 // Update the item. 226 // Update the item.
227 _blockPopupsItem.on = [_disablePopupsSetting value]; 227 _blockPopupsItem.on = [_disablePopupsSetting value];
228 228
229 // Update the cell. 229 // Update the cell.
230 [self reconfigureCellsForItems:@[ _blockPopupsItem ] 230 [self reconfigureCellsForItems:@[ _blockPopupsItem ]];
231 inSectionWithIdentifier:SectionIdentifierMainSwitch];
232 231
233 // Update the rest of the UI. 232 // Update the rest of the UI.
234 [self.editor setEditing:NO]; 233 [self.editor setEditing:NO];
235 [self updateEditButton]; 234 [self updateEditButton];
236 [self layoutSections:[_disablePopupsSetting value]]; 235 [self layoutSections:[_disablePopupsSetting value]];
237 } 236 }
238 237
239 #pragma mark - Actions 238 #pragma mark - Actions
240 239
241 - (void)blockPopupsSwitchChanged:(UISwitch*)switchView { 240 - (void)blockPopupsSwitchChanged:(UISwitch*)switchView {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 [[strongSelf collectionViewModel] 339 [[strongSelf collectionViewModel]
341 removeSectionWithIdentifier:SectionIdentifierExceptions]; 340 removeSectionWithIdentifier:SectionIdentifierExceptions];
342 [[strongSelf collectionView] 341 [[strongSelf collectionView]
343 deleteSections:[NSIndexSet indexSetWithIndex:index]]; 342 deleteSections:[NSIndexSet indexSetWithIndex:index]];
344 } 343 }
345 completion:nil]; 344 completion:nil];
346 } 345 }
347 } 346 }
348 347
349 @end 348 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698