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

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

Issue 17593006: mac: Update clients of scoped_nsobject.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iwyu, scoped_nsprotocol 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/base/cocoa/nib_loading.h" 5 #import "ui/base/cocoa/nib_loading.h"
6 6
7 #include "base/mac/bundle_locations.h" 7 #include "base/mac/bundle_locations.h"
8 #include "base/memory/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 9
10 namespace ui { 10 namespace ui {
11 11
12 NSView* GetViewFromNib(NSString* name) { 12 NSView* GetViewFromNib(NSString* name) {
13 scoped_nsobject<NSNib> nib( 13 base::scoped_nsobject<NSNib> nib(
14 [[NSNib alloc] initWithNibNamed:name 14 [[NSNib alloc] initWithNibNamed:name
15 bundle:base::mac::FrameworkBundle()]); 15 bundle:base::mac::FrameworkBundle()]);
16 if (!nib) 16 if (!nib)
17 return nil; 17 return nil;
18 18
19 NSArray* objects; 19 NSArray* objects;
20 BOOL success = [nib instantiateNibWithOwner:nil 20 BOOL success = [nib instantiateNibWithOwner:nil
21 topLevelObjects:&objects]; 21 topLevelObjects:&objects];
22 if (!success) 22 if (!success)
23 return nil; 23 return nil;
(...skipping 12 matching lines...) Expand all
36 if (![view isKindOfClass:[NSView class]]) 36 if (![view isKindOfClass:[NSView class]])
37 continue; 37 continue;
38 38
39 return [[view retain] autorelease]; 39 return [[view retain] autorelease];
40 } 40 }
41 41
42 return nil; 42 return nil;
43 } 43 }
44 44
45 } // namespace ui 45 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698