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