OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |