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

Side by Side Diff: base/mac/authorization_util.mm

Issue 9764013: Move authorization_util files into base/mac. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix license headers Created 8 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/authorization_util.h ('k') | base/mac/scoped_authorizationref.h » ('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 #include "chrome/browser/mac/authorization_util.h" 5 #include "base/mac/authorization_util.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #include <sys/wait.h> 8 #include <sys/wait.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/eintr_wrapper.h" 13 #include "base/eintr_wrapper.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/mac/bundle_locations.h" 15 #include "base/mac/bundle_locations.h"
16 #include "base/mac/mac_logging.h" 16 #include "base/mac/mac_logging.h"
17 #import "base/mac/mac_util.h" 17 #import "base/mac/mac_util.h"
18 #include "base/mac/scoped_authorizationref.h"
18 #include "base/string_number_conversions.h" 19 #include "base/string_number_conversions.h"
19 #include "base/string_util.h" 20 #include "base/string_util.h"
20 #include "chrome/browser/mac/scoped_authorizationref.h"
21 21
22 namespace authorization_util { 22 namespace base {
23 namespace mac {
23 24
24 AuthorizationRef AuthorizationCreateToRunAsRoot(CFStringRef prompt) { 25 AuthorizationRef AuthorizationCreateToRunAsRoot(CFStringRef prompt) {
25 // Create an empty AuthorizationRef. 26 // Create an empty AuthorizationRef.
26 ScopedAuthorizationRef authorization; 27 ScopedAuthorizationRef authorization;
27 OSStatus status = AuthorizationCreate(NULL, 28 OSStatus status = AuthorizationCreate(NULL,
28 kAuthorizationEmptyEnvironment, 29 kAuthorizationEmptyEnvironment,
29 kAuthorizationFlagDefaults, 30 kAuthorizationFlagDefaults,
30 &authorization); 31 &authorization);
31 if (status != errAuthorizationSuccess) { 32 if (status != errAuthorizationSuccess) {
32 OSSTATUS_LOG(ERROR, status) << "AuthorizationCreate"; 33 OSSTATUS_LOG(ERROR, status) << "AuthorizationCreate";
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 PLOG(ERROR) << "waitpid"; 176 PLOG(ERROR) << "waitpid";
176 *exit_status_pointer = -1; 177 *exit_status_pointer = -1;
177 } 178 }
178 } else { 179 } else {
179 *exit_status_pointer = -1; 180 *exit_status_pointer = -1;
180 } 181 }
181 182
182 return status; 183 return status;
183 } 184 }
184 185
185 } // namespace authorization_util 186 } // namespace mac
187 } // namespace base
OLDNEW
« no previous file with comments | « base/mac/authorization_util.h ('k') | base/mac/scoped_authorizationref.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698