1 // Copyright (c) 2011 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/ui/webui/options/advanced_options_utils.h" 8 9 #include "base/logging.h" 10 #include "base/mac/scoped_aedesc.h" 11 12 void AdvancedOptionsUtilities::ShowNetworkProxySettings( 13 TabContents* tab_contents) { 14 NSArray* itemsToOpen = [NSArray arrayWithObject:[NSURL fileURLWithPath: 15 @"/System/Library/PreferencePanes/Network.prefPane"]]; 16 17 const char* proxyPrefCommand = "Proxies"; 18 base::mac::ScopedAEDesc<> openParams; 19 OSStatus status = AECreateDesc('ptru', 20 proxyPrefCommand, 21 strlen(proxyPrefCommand), 22 openParams.OutPointer()); 23 LOG_IF(ERROR, status != noErr) << "Failed to create open params: " << status; 24 25 LSLaunchURLSpec launchSpec = { 0 }; 26 launchSpec.itemURLs = (CFArrayRef)itemsToOpen; 27 launchSpec.passThruParams = openParams; 28 launchSpec.launchFlags = kLSLaunchAsync | kLSLaunchDontAddToRecents; 29 LSOpenFromURLSpec(&launchSpec, NULL); 30 } 31 32 void AdvancedOptionsUtilities::ShowManageSSLCertificates( 33 TabContents* tab_contents) { 34 NSString* const kKeychainBundleId = @"com.apple.keychainaccess"; 35 [[NSWorkspace sharedWorkspace] 36 launchAppWithBundleIdentifier:kKeychainBundleId 37 options:0L 38 additionalEventParamDescriptor:nil 39 launchIdentifier:nil]; 40 } 41 42