| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/mac_logging.h" |
| 10 #include "base/mac/scoped_aedesc.h" | 11 #include "base/mac/scoped_aedesc.h" |
| 11 | 12 |
| 12 using content::WebContents; | 13 using content::WebContents; |
| 13 | 14 |
| 14 void AdvancedOptionsUtilities::ShowNetworkProxySettings( | 15 void AdvancedOptionsUtilities::ShowNetworkProxySettings( |
| 15 WebContents* web_contents) { | 16 WebContents* web_contents) { |
| 16 NSArray* itemsToOpen = [NSArray arrayWithObject:[NSURL fileURLWithPath: | 17 NSArray* itemsToOpen = [NSArray arrayWithObject:[NSURL fileURLWithPath: |
| 17 @"/System/Library/PreferencePanes/Network.prefPane"]]; | 18 @"/System/Library/PreferencePanes/Network.prefPane"]]; |
| 18 | 19 |
| 19 const char* proxyPrefCommand = "Proxies"; | 20 const char* proxyPrefCommand = "Proxies"; |
| 20 base::mac::ScopedAEDesc<> openParams; | 21 base::mac::ScopedAEDesc<> openParams; |
| 21 OSStatus status = AECreateDesc('ptru', | 22 OSStatus status = AECreateDesc('ptru', |
| 22 proxyPrefCommand, | 23 proxyPrefCommand, |
| 23 strlen(proxyPrefCommand), | 24 strlen(proxyPrefCommand), |
| 24 openParams.OutPointer()); | 25 openParams.OutPointer()); |
| 25 LOG_IF(ERROR, status != noErr) << "Failed to create open params: " << status; | 26 OSSTATUS_LOG_IF(ERROR, status != noErr, status) |
| 27 << "Failed to create open params"; |
| 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 WebContents* web_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 | |
| OLD | NEW |