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