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

Unified Diff: remoting/host/setup/daemon_controller_delegate_mac.mm

Issue 2393753003: Remove deprecated method LSOpenFSRef. (Closed)
Patch Set: nit Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/setup/daemon_controller_delegate_mac.mm
diff --git a/remoting/host/setup/daemon_controller_delegate_mac.mm b/remoting/host/setup/daemon_controller_delegate_mac.mm
index c8386ead79b682f67c8ad5e4b43f3651edddcbb3..461d14dd293494801ac213fbaa8d286265c69268 100644
--- a/remoting/host/setup/daemon_controller_delegate_mac.mm
+++ b/remoting/host/setup/daemon_controller_delegate_mac.mm
@@ -4,6 +4,8 @@
#include "remoting/host/setup/daemon_controller_delegate_mac.h"
+#import <AppKit/AppKit.h>
+
#include <CoreFoundation/CoreFoundation.h>
#include <launch.h>
#include <stdio.h>
@@ -21,6 +23,7 @@
#include "base/mac/mac_util.h"
#include "base/mac/scoped_launch_data.h"
#include "base/memory/ptr_util.h"
+#include "base/strings/sys_string_conversions.h"
#include "base/time/time.h"
#include "base/values.h"
#include "remoting/host/constants_mac.h"
@@ -211,15 +214,10 @@ bool DaemonControllerDelegateMac::DoShowPreferencePane(
}
pane_path = pane_path.Append("PreferencePanes").Append(kPrefPaneFileName);
- FSRef pane_path_ref;
- if (!base::mac::FSRefFromPath(pane_path.value(), &pane_path_ref)) {
- LOG(ERROR) << "Failed to create FSRef";
- return false;
- }
- OSStatus status = LSOpenFSRef(&pane_path_ref, nullptr);
- if (status != noErr) {
- OSSTATUS_LOG(ERROR, status) << "LSOpenFSRef failed for path: "
- << pane_path.value();
+ bool success = [[NSWorkspace sharedWorkspace]
+ openFile:base::SysUTF8ToNSString(pane_path.value())];
+ if (!success) {
+ LOG(ERROR) << "Failed to open preferences pane: " << pane_path.value();
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698