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