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 <sys/stat.h> | 10 #include <sys/stat.h> |
(...skipping 16 matching lines...) Expand all Loading... |
27 NSString* const kUserKsadminPath = | 27 NSString* const kUserKsadminPath = |
28 @"~~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/" | 28 @"~~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/" |
29 "Contents/MacOS/ksadmin"; | 29 "Contents/MacOS/ksadmin"; |
30 | 30 |
31 NSString* const kSystemMasterPrefsPath = | 31 NSString* const kSystemMasterPrefsPath = |
32 @"/Library/Google/Google Chrome Master Preferences"; | 32 @"/Library/Google/Google Chrome Master Preferences"; |
33 NSString* const kUserMasterPrefsPath = | 33 NSString* const kUserMasterPrefsPath = |
34 @"~~/Library/Application Support/Google/Chrome/" | 34 @"~~/Library/Application Support/Google/Chrome/" |
35 "Google Chrome Master Preferences"; | 35 "Google Chrome Master Preferences"; |
36 | 36 |
37 NSString* const kChannelKey = @"KSChannelID"; | |
38 NSString* const kVersionKey = @"KSVersion"; | |
39 | |
40 // Condensed from chromium's base/mac/mac_util.mm. | 37 // Condensed from chromium's base/mac/mac_util.mm. |
41 bool IsOSXVersionSupported() { | 38 bool IsOSXVersionSupported() { |
42 // On 10.6, Gestalt() was observed to be able to spawn threads (see | 39 // On 10.6, Gestalt() was observed to be able to spawn threads (see |
43 // http://crbug.com/53200). Don't call Gestalt(). | 40 // http://crbug.com/53200). Don't call Gestalt(). |
44 struct utsname uname_info; | 41 struct utsname uname_info; |
45 if (uname(&uname_info) != 0) | 42 if (uname(&uname_info) != 0) |
46 return false; | 43 return false; |
47 if (strcmp(uname_info.sysname, "Darwin") != 0) | 44 if (strcmp(uname_info.sysname, "Darwin") != 0) |
48 return false; | 45 return false; |
49 | 46 |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 else if (FindChromeTicket(kSystemTicket, NULL, &path) && path) | 452 else if (FindChromeTicket(kSystemTicket, NULL, &path) && path) |
456 app_path = path; | 453 app_path = path; |
457 else | 454 else |
458 app_path = kChromeInstallPath; | 455 app_path = kChromeInstallPath; |
459 | 456 |
460 // NSWorkspace launches processes as the current console owner, | 457 // NSWorkspace launches processes as the current console owner, |
461 // even when running with euid of 0. | 458 // even when running with euid of 0. |
462 return [[NSWorkspace sharedWorkspace] launchApplication:app_path]; | 459 return [[NSWorkspace sharedWorkspace] launchApplication:app_path]; |
463 } | 460 } |
464 } | 461 } |
OLD | NEW |