| 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 #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 Loading... |
| 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 //FIXME | 50 NSString* prompt_ns = reinterpret_cast<const NSString*>(prompt); |
| 51 NSString* prompt_ns = (NSString*)prompt; | |
| 52 const char* prompt_c = [prompt_ns UTF8String]; | 51 const char* prompt_c = [prompt_ns UTF8String]; |
| 53 size_t prompt_length = prompt_c ? strlen(prompt_c) : 0; | 52 size_t prompt_length = prompt_c ? strlen(prompt_c) : 0; |
| 54 | 53 |
| 55 AuthorizationItem environment_items[] = { | 54 AuthorizationItem environment_items[] = { |
| 56 {kAuthorizationEnvironmentIcon, icon_path_length, (void*)icon_path_c, 0}, | 55 {kAuthorizationEnvironmentIcon, icon_path_length, (void*)icon_path_c, 0}, |
| 57 {kAuthorizationEnvironmentPrompt, prompt_length, (void*)prompt_c, 0} | 56 {kAuthorizationEnvironmentPrompt, prompt_length, (void*)prompt_c, 0} |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 AuthorizationEnvironment environment = {arraysize(environment_items), | 59 AuthorizationEnvironment environment = {arraysize(environment_items), |
| 61 environment_items}; | 60 environment_items}; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 *exit_status_pointer = -1; | 173 *exit_status_pointer = -1; |
| 175 } | 174 } |
| 176 } else { | 175 } else { |
| 177 *exit_status_pointer = -1; | 176 *exit_status_pointer = -1; |
| 178 } | 177 } |
| 179 | 178 |
| 180 return status; | 179 return status; |
| 181 } | 180 } |
| 182 | 181 |
| 183 } // namespace authorization_util | 182 } // namespace authorization_util |
| OLD | NEW |