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