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.
5 #import "ui/base/cocoa/view_description.h"
9 @implementation NSView (CrDebugging)
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]),
16 prefix = [prefix stringByAppendingString:@"--"];
18 for (NSView* subview in [self subviews]) {
19 description = [description stringByAppendingString:
20 [subview cr_recursiveDescriptionWithPrefix:prefix]];
25 - (NSString*)cr_recursiveDescription {
26 return [self cr_recursiveDescriptionWithPrefix:@""];