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