| 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/block_popups_collection_view_controller.
h" | 5 #import "ios/chrome/browser/ui/settings/block_popups_collection_view_controller.
h" |
| 6 | 6 |
| 7 #import "base/ios/weak_nsobject.h" | 7 #import "base/ios/weak_nsobject.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #import "base/mac/foundation_util.h" | 9 #import "base/mac/foundation_util.h" |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 continue; | 289 continue; |
| 290 } | 290 } |
| 291 // The content settings UI does not support secondary content settings | 291 // The content settings UI does not support secondary content settings |
| 292 // pattern yet. For content settings set through the content settings UI the | 292 // pattern yet. For content settings set through the content settings UI the |
| 293 // secondary pattern is by default a wildcard pattern. Hence users are not | 293 // secondary pattern is by default a wildcard pattern. Hence users are not |
| 294 // able to modify content settings with a secondary pattern other than the | 294 // able to modify content settings with a secondary pattern other than the |
| 295 // wildcard pattern. So only show settings that the user is able to modify. | 295 // wildcard pattern. So only show settings that the user is able to modify. |
| 296 if (entries[i].secondary_pattern == ContentSettingsPattern::Wildcard() && | 296 if (entries[i].secondary_pattern == ContentSettingsPattern::Wildcard() && |
| 297 entries[i].setting == CONTENT_SETTING_ALLOW) { | 297 entries[i].setting == CONTENT_SETTING_ALLOW) { |
| 298 _exceptions.Append( | 298 _exceptions.Append( |
| 299 new base::StringValue(entries[i].primary_pattern.ToString())); | 299 new base::Value(entries[i].primary_pattern.ToString())); |
| 300 } else { | 300 } else { |
| 301 LOG(ERROR) << "Secondary content settings patterns are not " | 301 LOG(ERROR) << "Secondary content settings patterns are not " |
| 302 << "supported by the content settings UI"; | 302 << "supported by the content settings UI"; |
| 303 } | 303 } |
| 304 } | 304 } |
| 305 } | 305 } |
| 306 | 306 |
| 307 - (void)populateExceptionsItems { | 307 - (void)populateExceptionsItems { |
| 308 CollectionViewModel* model = self.collectionViewModel; | 308 CollectionViewModel* model = self.collectionViewModel; |
| 309 [model addSectionWithIdentifier:SectionIdentifierExceptions]; | 309 [model addSectionWithIdentifier:SectionIdentifierExceptions]; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 [[strongSelf collectionViewModel] | 357 [[strongSelf collectionViewModel] |
| 358 removeSectionWithIdentifier:SectionIdentifierExceptions]; | 358 removeSectionWithIdentifier:SectionIdentifierExceptions]; |
| 359 [[strongSelf collectionView] | 359 [[strongSelf collectionView] |
| 360 deleteSections:[NSIndexSet indexSetWithIndex:index]]; | 360 deleteSections:[NSIndexSet indexSetWithIndex:index]]; |
| 361 } | 361 } |
| 362 completion:nil]; | 362 completion:nil]; |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 | 365 |
| 366 @end | 366 @end |
| OLD | NEW |