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

Side by Side Diff: chrome/browser/cocoa/keystone_glue.mm

Issue 6594096: Clean up CF To NS Casts and make them slightly safer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix space Created 9 years, 9 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/cocoa/install_from_dmg.mm ('k') | chrome/browser/importer/safari_importer.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/cocoa/keystone_glue.h" 5 #import "chrome/browser/cocoa/keystone_glue.h"
6 6
7 #include <sys/param.h> 7 #include <sys/param.h>
8 #include <sys/mount.h> 8 #include <sys/mount.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 // asynchronous operation is pending, or even after promotion has already 750 // asynchronous operation is pending, or even after promotion has already
751 // occurred. Just quietly return without doing anything. 751 // occurred. Just quietly return without doing anything.
752 return; 752 return;
753 } 753 }
754 754
755 NSString* prompt = l10n_util::GetNSStringFWithFixup( 755 NSString* prompt = l10n_util::GetNSStringFWithFixup(
756 IDS_PROMOTE_AUTHENTICATION_PROMPT, 756 IDS_PROMOTE_AUTHENTICATION_PROMPT,
757 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 757 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
758 scoped_AuthorizationRef authorization( 758 scoped_AuthorizationRef authorization(
759 authorization_util::AuthorizationCreateToRunAsRoot( 759 authorization_util::AuthorizationCreateToRunAsRoot(
760 reinterpret_cast<CFStringRef>(prompt))); 760 base::mac::NSToCFCast(prompt)));
761 if (!authorization.get()) { 761 if (!authorization.get()) {
762 return; 762 return;
763 } 763 }
764 764
765 [self promoteTicketWithAuthorization:authorization.release() synchronous:NO]; 765 [self promoteTicketWithAuthorization:authorization.release() synchronous:NO];
766 } 766 }
767 767
768 - (void)promoteTicketWithAuthorization:(AuthorizationRef)authorization_arg 768 - (void)promoteTicketWithAuthorization:(AuthorizationRef)authorization_arg
769 synchronous:(BOOL)synchronous { 769 synchronous:(BOOL)synchronous {
770 scoped_AuthorizationRef authorization(authorization_arg); 770 scoped_AuthorizationRef authorization(authorization_arg);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 return [KeystoneGlue defaultKeystoneGlue] != nil; 948 return [KeystoneGlue defaultKeystoneGlue] != nil;
949 } 949 }
950 950
951 string16 CurrentlyInstalledVersion() { 951 string16 CurrentlyInstalledVersion() {
952 KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue]; 952 KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue];
953 NSString* version = [keystoneGlue currentlyInstalledVersion]; 953 NSString* version = [keystoneGlue currentlyInstalledVersion];
954 return base::SysNSStringToUTF16(version); 954 return base::SysNSStringToUTF16(version);
955 } 955 }
956 956
957 } // namespace keystone_glue 957 } // namespace keystone_glue
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/install_from_dmg.mm ('k') | chrome/browser/importer/safari_importer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698