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

Side by Side Diff: remoting/host/installer/mac/uninstaller/remoting_uninstaller.mm

Issue 986563003: base: Remove operator& from ScopedAuthorizationRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: authorization: for-official-build Created 5 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
« no previous file with comments | « base/mac/scoped_authorizationref.h ('k') | no next file » | 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 #include "remoting/host/installer/mac/uninstaller/remoting_uninstaller.h" 5 #include "remoting/host/installer/mac/uninstaller/remoting_uninstaller.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/mac/scoped_authorizationref.h" 9 #include "base/mac/scoped_authorizationref.h"
10 #include "remoting/host/constants_mac.h" 10 #include "remoting/host/constants_mac.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 [self sudoDelete:remoting::kLogFileConfigPath usingAuth:authRef]; 145 [self sudoDelete:remoting::kLogFileConfigPath usingAuth:authRef];
146 [self sudoDelete:remoting::kNativeMessagingManifestPath usingAuth:authRef]; 146 [self sudoDelete:remoting::kNativeMessagingManifestPath usingAuth:authRef];
147 [self sudoDelete:remoting::kBrandedUninstallerPath usingAuth:authRef]; 147 [self sudoDelete:remoting::kBrandedUninstallerPath usingAuth:authRef];
148 [self sudoDelete:remoting::kUnbrandedUninstallerPath usingAuth:authRef]; 148 [self sudoDelete:remoting::kUnbrandedUninstallerPath usingAuth:authRef];
149 149
150 [self keystoneUnregisterUsingAuth:authRef]; 150 [self keystoneUnregisterUsingAuth:authRef];
151 } 151 }
152 152
153 - (OSStatus)remotingUninstall { 153 - (OSStatus)remotingUninstall {
154 base::mac::ScopedAuthorizationRef authRef; 154 base::mac::ScopedAuthorizationRef authRef;
155 OSStatus status = AuthorizationCreate(nullptr, kAuthorizationEmptyEnvironment, 155 OSStatus status =
156 kAuthorizationFlagDefaults, &authRef); 156 AuthorizationCreate(nullptr, kAuthorizationEmptyEnvironment,
157 kAuthorizationFlagDefaults, authRef.get_pointer());
157 if (status != errAuthorizationSuccess) { 158 if (status != errAuthorizationSuccess) {
158 [NSException raise:@"AuthorizationCreate Failure" 159 [NSException raise:@"AuthorizationCreate Failure"
159 format:@"Error during AuthorizationCreate status=%d", 160 format:@"Error during AuthorizationCreate status=%d",
160 static_cast<int>(status)]; 161 static_cast<int>(status)];
161 } 162 }
162 163
163 AuthorizationItem right = {kAuthorizationRightExecute, 0, nullptr, 0}; 164 AuthorizationItem right = {kAuthorizationRightExecute, 0, nullptr, 0};
164 AuthorizationRights rights = {1, &right}; 165 AuthorizationRights rights = {1, &right};
165 AuthorizationFlags flags = kAuthorizationFlagDefaults | 166 AuthorizationFlags flags = kAuthorizationFlagDefaults |
166 kAuthorizationFlagInteractionAllowed | 167 kAuthorizationFlagInteractionAllowed |
167 kAuthorizationFlagPreAuthorize | 168 kAuthorizationFlagPreAuthorize |
168 kAuthorizationFlagExtendRights; 169 kAuthorizationFlagExtendRights;
169 status = AuthorizationCopyRights(authRef, &rights, nullptr, flags, nullptr); 170 status = AuthorizationCopyRights(authRef, &rights, nullptr, flags, nullptr);
170 if (status == errAuthorizationSuccess) { 171 if (status == errAuthorizationSuccess) {
171 RemotingUninstaller* uninstaller = 172 RemotingUninstaller* uninstaller =
172 [[[RemotingUninstaller alloc] init] autorelease]; 173 [[[RemotingUninstaller alloc] init] autorelease];
173 [uninstaller remotingUninstallUsingAuth:authRef]; 174 [uninstaller remotingUninstallUsingAuth:authRef];
174 } 175 }
175 return status; 176 return status;
176 } 177 }
177 178
178 @end 179 @end
OLDNEW
« no previous file with comments | « base/mac/scoped_authorizationref.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698