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

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: fix rebase 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..1c13b8c3d5ac4d0c43b8c2f62afbc5998f2fc7ec 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,21 +30,20 @@
- (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);
+ 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);
+ 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);
+ 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);
+ NULL, &ref, NULL);
if (status != noErr) {
OSSTATUS_LOG(ERROR, status) << "Failed to make path ref";
@@ -70,8 +70,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