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

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

Issue 2889183005: Show all mailto: handlers, but dim unavailable ones. (Closed)
Patch Set: fixed BUILD.gn and unit tests 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/content_settings_collection_view_control ler.h" 5 #import "ios/chrome/browser/ui/settings/content_settings_collection_view_control ler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "components/content_settings/core/browser/host_content_settings_map.h" 8 #include "components/content_settings/core/browser/host_content_settings_map.h"
9 #include "components/content_settings/core/common/content_settings.h" 9 #include "components/content_settings/core/common/content_settings.h"
10 #include "components/content_settings/core/common/content_settings_types.h" 10 #include "components/content_settings/core/common/content_settings_types.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 - (void)loadModel { 126 - (void)loadModel {
127 [super loadModel]; 127 [super loadModel];
128 128
129 CollectionViewModel* model = self.collectionViewModel; 129 CollectionViewModel* model = self.collectionViewModel;
130 [model addSectionWithIdentifier:SectionIdentifierSettings]; 130 [model addSectionWithIdentifier:SectionIdentifierSettings];
131 [model addItem:[self blockPopupsItem] 131 [model addItem:[self blockPopupsItem]
132 toSectionWithIdentifier:SectionIdentifierSettings]; 132 toSectionWithIdentifier:SectionIdentifierSettings];
133 [model addItem:[self translateItem] 133 [model addItem:[self translateItem]
134 toSectionWithIdentifier:SectionIdentifierSettings]; 134 toSectionWithIdentifier:SectionIdentifierSettings];
135 if (!experimental_flags::IsNativeAppLauncherEnabled() && 135 if (!experimental_flags::IsNativeAppLauncherEnabled()) {
136 [[_mailtoURLRewriter defaultHandlers] count] > 1) {
137 [model addItem:[self composeEmailItem] 136 [model addItem:[self composeEmailItem]
138 toSectionWithIdentifier:SectionIdentifierSettings]; 137 toSectionWithIdentifier:SectionIdentifierSettings];
139 } 138 }
140 } 139 }
141 140
142 - (CollectionViewItem*)blockPopupsItem { 141 - (CollectionViewItem*)blockPopupsItem {
143 _blockPopupsDetailItem = [[CollectionViewDetailItem alloc] 142 _blockPopupsDetailItem = [[CollectionViewDetailItem alloc]
144 initWithType:ItemTypeSettingsBlockPopups]; 143 initWithType:ItemTypeSettingsBlockPopups];
145 NSString* subtitle = [_disablePopupsSetting value] 144 NSString* subtitle = [_disablePopupsSetting value]
146 ? l10n_util::GetNSString(IDS_IOS_SETTING_ON) 145 ? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 #pragma mark - MailtoURLRewriterObserver 245 #pragma mark - MailtoURLRewriterObserver
247 246
248 - (void)rewriterDidChange:(MailtoURLRewriter*)rewriter { 247 - (void)rewriterDidChange:(MailtoURLRewriter*)rewriter {
249 if (rewriter != _mailtoURLRewriter) 248 if (rewriter != _mailtoURLRewriter)
250 return; 249 return;
251 _composeEmailDetailItem.detailText = [rewriter defaultHandlerName]; 250 _composeEmailDetailItem.detailText = [rewriter defaultHandlerName];
252 [self reconfigureCellsForItems:@[ _composeEmailDetailItem ]]; 251 [self reconfigureCellsForItems:@[ _composeEmailDetailItem ]];
253 } 252 }
254 253
255 @end 254 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698