OLD | NEW |
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/installer/gcapi_mac/gcapi.h" | 5 #include "chrome/installer/gcapi_mac/gcapi.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #include <grp.h> | 8 #include <grp.h> |
9 #include <pwd.h> | 9 #include <pwd.h> |
| 10 #include <stddef.h> |
10 #include <sys/stat.h> | 11 #include <sys/stat.h> |
11 #include <sys/types.h> | 12 #include <sys/types.h> |
12 #include <sys/utsname.h> | 13 #include <sys/utsname.h> |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 // The "~~" prefixes are replaced with the home directory of the | 17 // The "~~" prefixes are replaced with the home directory of the |
17 // console owner (i.e. not the home directory of the euid). | 18 // console owner (i.e. not the home directory of the euid). |
18 NSString* const kChromeInstallPath = @"/Applications/Google Chrome.app"; | 19 NSString* const kChromeInstallPath = @"/Applications/Google Chrome.app"; |
19 | 20 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 else if (FindChromeTicket(kSystemTicket, NULL, &path) && path) | 453 else if (FindChromeTicket(kSystemTicket, NULL, &path) && path) |
453 app_path = path; | 454 app_path = path; |
454 else | 455 else |
455 app_path = kChromeInstallPath; | 456 app_path = kChromeInstallPath; |
456 | 457 |
457 // NSWorkspace launches processes as the current console owner, | 458 // NSWorkspace launches processes as the current console owner, |
458 // even when running with euid of 0. | 459 // even when running with euid of 0. |
459 return [[NSWorkspace sharedWorkspace] launchApplication:app_path]; | 460 return [[NSWorkspace sharedWorkspace] launchApplication:app_path]; |
460 } | 461 } |
461 } | 462 } |
OLD | NEW |