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

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

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 "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/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 18 matching lines...) Expand all
29 29
30 @interface ExternalProtocolDialogController(Private) 30 @interface ExternalProtocolDialogController(Private)
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(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type());
40 40
41 if (!(self = [super init])) 41 if (!(self = [super init]))
42 return nil; 42 return nil;
43 43
44 url_ = *url; 44 url_ = *url;
45 creation_time_ = base::Time::Now(); 45 creation_time_ = base::Time::Now();
46 46
47 string16 appName = [self appNameForProtocol]; 47 string16 appName = [self appNameForProtocol];
48 if (appName.length() == 0) { 48 if (appName.length() == 0) {
49 // No registered apps for this protocol; give up and go home. 49 // No registered apps for this protocol; give up and go home.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 NSString* appPath = [(NSURL*)openingApp path]; 148 NSString* appPath = [(NSURL*)openingApp path];
149 CFRelease(openingApp); // NOT A BUG; LSGetApplicationForURL retains for us 149 CFRelease(openingApp); // NOT A BUG; LSGetApplicationForURL retains for us
150 NSString* appDisplayName = 150 NSString* appDisplayName =
151 [[NSFileManager defaultManager] displayNameAtPath:appPath]; 151 [[NSFileManager defaultManager] displayNameAtPath:appPath];
152 152
153 return base::SysNSStringToUTF16(appDisplayName); 153 return base::SysNSStringToUTF16(appDisplayName);
154 } 154 }
155 155
156 @end 156 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm ('k') | chrome/browser/ui/cocoa/first_run_dialog.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698