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

Unified Diff: chrome/service/chrome_service_application_mac.mm

Issue 12178030: [mac] Delete app shortcuts on app uninstall. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/web_applications/web_app_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/chrome_service_application_mac.mm
diff --git a/chrome/service/chrome_service_application_mac.mm b/chrome/service/chrome_service_application_mac.mm
index 0b9bc7c85f10b31f473a52bb23f5db0145a41bc9..1f44b94fc88e5df56ce9c01d4134bcedbcbdc206 100644
--- a/chrome/service/chrome_service_application_mac.mm
+++ b/chrome/service/chrome_service_application_mac.mm
@@ -6,6 +6,7 @@
#include "base/mac/foundation_util.h"
#include "base/mac/mac_logging.h"
+#include "base/sys_string_conversions.h"
#import "chrome/common/cloud_print/cloud_print_class_mac.h"
#include "chrome/common/chrome_switches.h"
@@ -29,18 +30,18 @@
- (void)submitPrint:(NSAppleEventDescriptor*)event {
std::string silent = std::string("--") + switches::kNoStartupWindow;
// Set up flag so that it can be passed along with the Apple Event.
- CFStringRef silentLaunchFlag =
- CFStringCreateWithCString(NULL, silent.c_str(), kCFStringEncodingUTF8);
Avi (use Gerrit) 2013/02/05 05:15:49 Yikes. This leaked...
+ base::mac::ScopedCFTypeRef<CFStringRef> silentLaunchFlag(
+ base::SysUTF8ToCFStringRef(silent));
CFStringRef flags[] = { silentLaunchFlag };
// Argv array that will be passed.
- CFArrayRef passArgv =
- CFArrayCreate(NULL, (const void**) flags, 1, &kCFTypeArrayCallBacks);
Avi (use Gerrit) 2013/02/05 05:15:49 Did this leak? What does LSApplicationParameters r
jeremya 2013/02/05 05:42:15 I think so. I can't find any documentation saying
+ base::mac::ScopedCFTypeRef<CFArrayRef> passArgv(
+ CFArrayCreate(NULL, (const void**) flags, 1, &kCFTypeArrayCallBacks));
FSRef ref;
CFURLRef* kDontWantURL = NULL;
// Get Chrome's bundle ID.
- std::string bundleID = base::mac::BaseBundleID();
- CFStringRef bundleIDCF =
- CFStringCreateWithCString(NULL, bundleID.c_str(), kCFStringEncodingUTF8);
Avi (use Gerrit) 2013/02/05 05:15:49 .. and this clearly leaked.
+ std::string bundleID = base::mac::BaseBundleID();
+ base::mac::ScopedCFTypeRef<CFStringRef> bundleIDCF(
+ base::SysUTF8ToCFStringRef(bundleID));
// Use Launch Services to locate Chrome using its bundleID.
OSStatus status = LSFindApplicationForInfo(kLSUnknownCreator, bundleIDCF,
NULL, &ref, kDontWantURL);
Avi (use Gerrit) 2013/02/05 05:15:49 Put a null in this last parameter rather than this
jeremya 2013/02/05 05:42:15 Done.
@@ -70,8 +71,8 @@
NULL,
passArgv,
NULL };
- AEDesc* initialEvent = const_cast<AEDesc*> ([sendEvent aeDesc]);
- params.initialEvent = static_cast<AppleEvent*> (initialEvent);
+ AEDesc* initialEvent = const_cast<AEDesc*>([sendEvent aeDesc]);
+ params.initialEvent = static_cast<AppleEvent*>(initialEvent);
// Send the Apple Event Using launch services, launching Chrome if necessary.
status = LSOpenApplication(&params, NULL);
if (status != noErr) {
« no previous file with comments | « chrome/browser/web_applications/web_app_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698