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

Side by Side Diff: ui/base/cocoa/view_description.mm

Issue 16266010: Add -[NSView(CrDebugging) cr_recursiveDescription]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/cocoa/view_description.h ('k') | ui/ui.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ui/base/cocoa/view_description.h"
6
7 #if !NDEBUG
8
9 @implementation NSView (CrDebugging)
10
11 - (NSString*)cr_recursiveDescriptionWithPrefix:(NSString*)prefix {
12 NSString* description =
13 [NSString stringWithFormat:@"%@ <%@ %p, frame=%@, hidden=%d>\n",
14 prefix, [self class], self, NSStringFromRect([self frame]),
15 [self isHidden]];
16 prefix = [prefix stringByAppendingString:@"--"];
17
18 for (NSView* subview in [self subviews]) {
19 description = [description stringByAppendingString:
20 [subview cr_recursiveDescriptionWithPrefix:prefix]];
21 }
22 return description;
23 }
24
25 - (NSString*)cr_recursiveDescription {
26 return [self cr_recursiveDescriptionWithPrefix:@""];
27 }
28
29 @end
30
31 #endif // !NDEBUG
OLDNEW
« no previous file with comments | « ui/base/cocoa/view_description.h ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698