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

Side by Side Diff: ios/showcase/common/protocol_alerter.mm

Issue 2697573002: Modify article item in ContentSuggestions (Closed)
Patch Set: Fix tests Created 3 years, 10 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
« no previous file with comments | « ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/showcase/common/protocol_alerter.h" 5 #import "ios/showcase/common/protocol_alerter.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 8
9 #import "base/logging.h" 9 #import "base/logging.h"
10 #import "base/strings/sys_string_conversions.h" 10 #import "base/strings/sys_string_conversions.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 - (NSString*)argumentDescriptionAtIndex:(NSInteger)index { 155 - (NSString*)argumentDescriptionAtIndex:(NSInteger)index {
156 const char* type = [self.methodSignature getArgumentTypeAtIndex:index]; 156 const char* type = [self.methodSignature getArgumentTypeAtIndex:index];
157 157
158 switch (*type) { 158 switch (*type) {
159 case '@': 159 case '@':
160 return [self objectDescriptionAtIndex:index]; 160 return [self objectDescriptionAtIndex:index];
161 case 'q': 161 case 'q':
162 return [self longLongDescriptionAtIndex:index]; 162 return [self longLongDescriptionAtIndex:index];
163 // Add cases as needed here. 163 // Add cases as needed here.
164 default: 164 default:
165 return [NSString stringWithFormat:@"<Unknown Type:%c>", *type]; 165 return [NSString stringWithFormat:@"<Unknown Type:%s>", type];
166 } 166 }
167 } 167 }
168 168
169 // Return a string describing an argument at |index| that's known to be an 169 // Return a string describing an argument at |index| that's known to be an
170 // objective-C object. 170 // objective-C object.
171 - (NSString*)objectDescriptionAtIndex:(NSInteger)index { 171 - (NSString*)objectDescriptionAtIndex:(NSInteger)index {
172 id object; 172 id object;
173 173
174 [self getArgument:&object atIndex:index]; 174 [self getArgument:&object atIndex:index];
175 if (!object) 175 if (!object)
(...skipping 27 matching lines...) Expand all
203 // Returns a string describing an argument at |index| that is known to be a long 203 // Returns a string describing an argument at |index| that is known to be a long
204 // long. 204 // long.
205 - (NSString*)longLongDescriptionAtIndex:(NSInteger)index { 205 - (NSString*)longLongDescriptionAtIndex:(NSInteger)index {
206 long long value; 206 long long value;
207 207
208 [self getArgument:&value atIndex:index]; 208 [self getArgument:&value atIndex:index];
209 return [NSString stringWithFormat:@"%lld", value]; 209 return [NSString stringWithFormat:@"%lld", value];
210 } 210 }
211 211
212 @end 212 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698