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