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

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

Issue 2762014: Mac: clang build (Closed)
Patch Set: more Created 10 years, 6 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
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 #include "chrome/browser/cocoa/authorization_util.h" 5 #include "chrome/browser/cocoa/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>
(...skipping 29 matching lines...) Expand all
40 // product_logo_32.png is used instead of app.icns because Authorization 40 // product_logo_32.png is used instead of app.icns because Authorization
41 // Services can't deal with .icns files. 41 // Services can't deal with .icns files.
42 NSString* icon_path = 42 NSString* icon_path =
43 [mac_util::MainAppBundle() pathForResource:@"product_logo_32" 43 [mac_util::MainAppBundle() pathForResource:@"product_logo_32"
44 ofType:@"png"]; 44 ofType:@"png"];
45 const char* icon_path_c = [icon_path fileSystemRepresentation]; 45 const char* icon_path_c = [icon_path fileSystemRepresentation];
46 size_t icon_path_length = icon_path_c ? strlen(icon_path_c) : 0; 46 size_t icon_path_length = icon_path_c ? strlen(icon_path_c) : 0;
47 47
48 // The OS will append " Type an administrator's name and password to allow 48 // The OS will append " Type an administrator's name and password to allow
49 // <CFBundleDisplayName> to make changes." 49 // <CFBundleDisplayName> to make changes."
50 NSString* prompt_ns = reinterpret_cast<const NSString*>(prompt); 50 //FIXME
51 NSString* prompt_ns = (NSString*)prompt;
51 const char* prompt_c = [prompt_ns UTF8String]; 52 const char* prompt_c = [prompt_ns UTF8String];
52 size_t prompt_length = prompt_c ? strlen(prompt_c) : 0; 53 size_t prompt_length = prompt_c ? strlen(prompt_c) : 0;
53 54
54 AuthorizationItem environment_items[] = { 55 AuthorizationItem environment_items[] = {
55 {kAuthorizationEnvironmentIcon, icon_path_length, (void*)icon_path_c, 0}, 56 {kAuthorizationEnvironmentIcon, icon_path_length, (void*)icon_path_c, 0},
56 {kAuthorizationEnvironmentPrompt, prompt_length, (void*)prompt_c, 0} 57 {kAuthorizationEnvironmentPrompt, prompt_length, (void*)prompt_c, 0}
57 }; 58 };
58 59
59 AuthorizationEnvironment environment = {arraysize(environment_items), 60 AuthorizationEnvironment environment = {arraysize(environment_items),
60 environment_items}; 61 environment_items};
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // local version. 161 // local version.
161 int local_exit_status; 162 int local_exit_status;
162 int* exit_status_pointer; 163 int* exit_status_pointer;
163 if (exit_status) { 164 if (exit_status) {
164 exit_status_pointer = exit_status; 165 exit_status_pointer = exit_status;
165 } else { 166 } else {
166 exit_status_pointer = &local_exit_status; 167 exit_status_pointer = &local_exit_status;
167 } 168 }
168 169
169 if (pid != -1) { 170 if (pid != -1) {
170 pid_t wait_result; 171 pid_t wait_result = HANDLE_EINTR(waitpid(pid, exit_status_pointer, 0));
171 HANDLE_EINTR(wait_result = waitpid(pid, exit_status_pointer, 0));
172 if (wait_result != pid) { 172 if (wait_result != pid) {
173 PLOG(ERROR) << "waitpid"; 173 PLOG(ERROR) << "waitpid";
174 *exit_status_pointer = -1; 174 *exit_status_pointer = -1;
175 } 175 }
176 } else { 176 } else {
177 *exit_status_pointer = -1; 177 *exit_status_pointer = -1;
178 } 178 }
179 179
180 return status; 180 return status;
181 } 181 }
182 182
183 } // namespace authorization_util 183 } // namespace authorization_util
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_application_mac.mm ('k') | chrome/browser/cocoa/background_gradient_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698