Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(780)

Side by Side Diff: chrome/browser/ui/webui/options2/advanced_options_utils2_mac.mm

Issue 9235084: Add OSSTATUS_LOG API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/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/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 namespace options2 { 15 namespace options2 {
15 16
16 void AdvancedOptionsUtilities::ShowNetworkProxySettings( 17 void AdvancedOptionsUtilities::ShowNetworkProxySettings(
17 WebContents* web_contents) { 18 WebContents* web_contents) {
18 NSArray* itemsToOpen = [NSArray arrayWithObject:[NSURL fileURLWithPath: 19 NSArray* itemsToOpen = [NSArray arrayWithObject:[NSURL fileURLWithPath:
19 @"/System/Library/PreferencePanes/Network.prefPane"]]; 20 @"/System/Library/PreferencePanes/Network.prefPane"]];
20 21
21 const char* proxyPrefCommand = "Proxies"; 22 const char* proxyPrefCommand = "Proxies";
22 base::mac::ScopedAEDesc<> openParams; 23 base::mac::ScopedAEDesc<> openParams;
23 OSStatus status = AECreateDesc('ptru', 24 OSStatus status = AECreateDesc('ptru',
24 proxyPrefCommand, 25 proxyPrefCommand,
25 strlen(proxyPrefCommand), 26 strlen(proxyPrefCommand),
26 openParams.OutPointer()); 27 openParams.OutPointer());
27 LOG_IF(ERROR, status != noErr) << "Failed to create open params: " << status; 28 OSSTATUS_LOG_IF(ERROR, status != noErr, status)
29 << "Failed to create open params";
28 30
29 LSLaunchURLSpec launchSpec = { 0 }; 31 LSLaunchURLSpec launchSpec = { 0 };
30 launchSpec.itemURLs = (CFArrayRef)itemsToOpen; 32 launchSpec.itemURLs = (CFArrayRef)itemsToOpen;
31 launchSpec.passThruParams = openParams; 33 launchSpec.passThruParams = openParams;
32 launchSpec.launchFlags = kLSLaunchAsync | kLSLaunchDontAddToRecents; 34 launchSpec.launchFlags = kLSLaunchAsync | kLSLaunchDontAddToRecents;
33 LSOpenFromURLSpec(&launchSpec, NULL); 35 LSOpenFromURLSpec(&launchSpec, NULL);
34 } 36 }
35 37
36 void AdvancedOptionsUtilities::ShowManageSSLCertificates( 38 void AdvancedOptionsUtilities::ShowManageSSLCertificates(
37 WebContents* web_contents) { 39 WebContents* web_contents) {
38 NSString* const kKeychainBundleId = @"com.apple.keychainaccess"; 40 NSString* const kKeychainBundleId = @"com.apple.keychainaccess";
39 [[NSWorkspace sharedWorkspace] 41 [[NSWorkspace sharedWorkspace]
40 launchAppWithBundleIdentifier:kKeychainBundleId 42 launchAppWithBundleIdentifier:kKeychainBundleId
41 options:0L 43 options:0L
42 additionalEventParamDescriptor:nil 44 additionalEventParamDescriptor:nil
43 launchIdentifier:nil]; 45 launchIdentifier:nil];
44 } 46 }
45 47
46 } // namespace options2 48 } // namespace options2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698