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

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

Issue 141683005: Removes MessageLoop::Type checks in favor of IsCurrent on MessageLoops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: base:: Created 6 years, 11 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 | « chrome/browser/printing/printer_query.cc ('k') | chrome/browser/ui/gtk/protocol_dialog_gtk.cc » ('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) 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/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 22 matching lines...) Expand all
33 - (void)alertEnded:(NSAlert *)alert 33 - (void)alertEnded:(NSAlert *)alert
34 returnCode:(int)returnCode 34 returnCode:(int)returnCode
35 contextInfo:(void*)contextInfo; 35 contextInfo:(void*)contextInfo;
36 - (base::string16)appNameForProtocol; 36 - (base::string16)appNameForProtocol;
37 @end 37 @end
38 38
39 @implementation ExternalProtocolDialogController 39 @implementation ExternalProtocolDialogController
40 - (id)initWithGURL:(const GURL*)url 40 - (id)initWithGURL:(const GURL*)url
41 renderProcessHostId:(int)renderProcessHostId 41 renderProcessHostId:(int)renderProcessHostId
42 routingId:(int)routingId { 42 routingId:(int)routingId {
43 DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); 43 DCHECK(base::MessageLoopForUI::IsCurrent());
44 44
45 if (!(self = [super init])) 45 if (!(self = [super init]))
46 return nil; 46 return nil;
47 47
48 url_ = *url; 48 url_ = *url;
49 render_process_host_id_ = renderProcessHostId; 49 render_process_host_id_ = renderProcessHostId;
50 routing_id_ = routingId; 50 routing_id_ = routingId;
51 creation_time_ = base::Time::Now(); 51 creation_time_ = base::Time::Now();
52 52
53 base::string16 appName = [self appNameForProtocol]; 53 base::string16 appName = [self appNameForProtocol];
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 NSString* appPath = [(NSURL*)openingApp path]; 155 NSString* appPath = [(NSURL*)openingApp path];
156 CFRelease(openingApp); // NOT A BUG; LSGetApplicationForURL retains for us 156 CFRelease(openingApp); // NOT A BUG; LSGetApplicationForURL retains for us
157 NSString* appDisplayName = 157 NSString* appDisplayName =
158 [[NSFileManager defaultManager] displayNameAtPath:appPath]; 158 [[NSFileManager defaultManager] displayNameAtPath:appPath];
159 159
160 return base::SysNSStringToUTF16(appDisplayName); 160 return base::SysNSStringToUTF16(appDisplayName);
161 } 161 }
162 162
163 @end 163 @end
OLDNEW
« no previous file with comments | « chrome/browser/printing/printer_query.cc ('k') | chrome/browser/ui/gtk/protocol_dialog_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698