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

Side by Side Diff: chrome/browser/ui/cocoa/external_protocol_dialog.mm

Issue 10031018: Add a few missing "self = [super init..." notices by the clang static analyzer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « no previous file | chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/cocoa/external_protocol_dialog.h" 5 #import "chrome/browser/ui/cocoa/external_protocol_dialog.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 20 matching lines...) Expand all
31 - (void)alertEnded:(NSAlert *)alert 31 - (void)alertEnded:(NSAlert *)alert
32 returnCode:(int)returnCode 32 returnCode:(int)returnCode
33 contextInfo:(void*)contextInfo; 33 contextInfo:(void*)contextInfo;
34 - (string16)appNameForProtocol; 34 - (string16)appNameForProtocol;
35 @end 35 @end
36 36
37 @implementation ExternalProtocolDialogController 37 @implementation ExternalProtocolDialogController
38 - (id)initWithGURL:(const GURL*)url { 38 - (id)initWithGURL:(const GURL*)url {
39 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); 39 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type());
40 40
41 if (!(self = [super init]))
42 return nil;
43
41 url_ = *url; 44 url_ = *url;
42 creation_time_ = base::Time::Now(); 45 creation_time_ = base::Time::Now();
43 46
44 string16 appName = [self appNameForProtocol]; 47 string16 appName = [self appNameForProtocol];
45 if (appName.length() == 0) { 48 if (appName.length() == 0) {
46 // No registered apps for this protocol; give up and go home. 49 // No registered apps for this protocol; give up and go home.
47 [self autorelease]; 50 [self autorelease];
48 return nil; 51 return nil;
49 } 52 }
50 53
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 147 }
145 NSString* appPath = [(NSURL*)openingApp path]; 148 NSString* appPath = [(NSURL*)openingApp path];
146 CFRelease(openingApp); // NOT A BUG; LSGetApplicationForURL retains for us 149 CFRelease(openingApp); // NOT A BUG; LSGetApplicationForURL retains for us
147 NSString* appDisplayName = 150 NSString* appDisplayName =
148 [[NSFileManager defaultManager] displayNameAtPath:appPath]; 151 [[NSFileManager defaultManager] displayNameAtPath:appPath];
149 152
150 return base::SysNSStringToUTF16(appDisplayName); 153 return base::SysNSStringToUTF16(appDisplayName);
151 } 154 }
152 155
153 @end 156 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698