OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import <Cocoa/Cocoa.h> |
| 6 |
| 7 #include "chrome/browser/dom_ui/advanced_options_utils_mac.h" |
| 8 #include "base/logging.h" |
| 9 |
| 10 void AdvancedOptionsUtilities::ShowNetworkProxySettings() { |
| 11 NSArray* itemsToOpen = [NSArray arrayWithObject:[NSURL fileURLWithPath: |
| 12 @"/System/Library/PreferencePanes/Network.prefPane"]]; |
| 13 |
| 14 const char* proxyPrefCommand = "Proxies"; |
| 15 AEDesc openParams = { typeNull, NULL }; |
| 16 OSStatus status = AECreateDesc('ptru', |
| 17 proxyPrefCommand, |
| 18 strlen(proxyPrefCommand), |
| 19 &openParams); |
| 20 LOG_IF(ERROR, status != noErr) << "Failed to create open params: " << status; |
| 21 |
| 22 LSLaunchURLSpec launchSpec = { 0 }; |
| 23 launchSpec.itemURLs = (CFArrayRef)itemsToOpen; |
| 24 launchSpec.passThruParams = &openParams; |
| 25 launchSpec.launchFlags = kLSLaunchAsync | kLSLaunchDontAddToRecents; |
| 26 LSOpenFromURLSpec(&launchSpec, NULL); |
| 27 |
| 28 if (openParams.descriptorType != typeNull) |
| 29 AEDisposeDesc(&openParams); |
| 30 } |
| 31 |
| 32 void AdvancedOptionsUtilities::ShowManageSSLCertificates() { |
| 33 NSString* const kKeychainBundleId = @"com.apple.keychainaccess"; |
| 34 [[NSWorkspace sharedWorkspace] |
| 35 launchAppWithBundleIdentifier:kKeychainBundleId |
| 36 options:0L |
| 37 additionalEventParamDescriptor:nil |
| 38 launchIdentifier:nil]; |
| 39 } |
| 40 |
OLD | NEW |