diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-24 03:47:59 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-24 03:47:59 +0000 |
commit | 1dd17d77d24a3232976e03b3ec5c7c61a14f1015 (patch) | |
tree | 1908be9b6513b74a7b90b1d45b98a2827efa5d12 /chrome/browser/mac | |
parent | 051b520a6c03a0bbb1e6385cff114411296b52d1 (diff) | |
download | chromium_src-1dd17d77d24a3232976e03b3ec5c7c61a14f1015.zip chromium_src-1dd17d77d24a3232976e03b3ec5c7c61a14f1015.tar.gz chromium_src-1dd17d77d24a3232976e03b3ec5c7c61a14f1015.tar.bz2 |
Fix install-from-dmg.
When installing from a disk image, the browser relaunched from the
newly-installed location should follow the proper first-run experience if
appropriate.
When installing from a disk image, existing dock tiles should be reused, and
dock tiles pointing at the application on the disk image should be replaced
with ones pointing at the newly-installed location.
When installing from a disk image and requesting administrator access (because
the user does not have permission to install to /Applications), Keystone
should be promoted to a system-level install, and Chrome's Keystone ticket
should be promoted to a system Keystone ticket.
The custom panel key window tracking stuff doesn't need to maintain strong
references to key windows, but does need to be beefed up for thread safety.
Chrome doesn't need to wait until it's mostly started up to run the
install-from-dmg flow. It should do it early, avoiding delays and reducing the
possibility that harmful services will start running.
BUG=119325
TEST=obvious from the above and the bug
Review URL: http://codereview.chromium.org/9814029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128677 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/mac')
-rw-r--r-- | chrome/browser/mac/dock.mm | 17 | ||||
-rw-r--r-- | chrome/browser/mac/keystone_glue.mm | 13 |
2 files changed, 17 insertions, 13 deletions
diff --git a/chrome/browser/mac/dock.mm b/chrome/browser/mac/dock.mm index 0c52150..39c33b9 100644 --- a/chrome/browser/mac/dock.mm +++ b/chrome/browser/mac/dock.mm @@ -243,24 +243,15 @@ void AddIcon(NSString* installed_path, NSString* dmg_app_path) { return; } - // Directories in the Dock's plist are given with trailing slashes. Since - // installed_path and dmg_app_path both refer to application bundles, - // they're directories and will show up with trailing slashes. This is an - // artifact of the Dock's internal use of CFURL. Look for paths that match, - // and when adding an item to the Dock's plist, keep it in the form that the - // Dock likes. - NSString* installed_path_dock = [installed_path stringByAppendingString:@"/"]; - NSString* dmg_app_path_dock = [dmg_app_path stringByAppendingString:@"/"]; - NSUInteger already_installed_app_index = NSNotFound; NSUInteger app_index = NSNotFound; for (NSUInteger index = 0; index < [persistent_apps count]; ++index) { NSString* app_path = [persistent_app_paths objectAtIndex:index]; - if ([app_path isEqualToString:installed_path_dock]) { + if ([app_path isEqualToString:installed_path]) { // If the Dock already contains a reference to the newly installed // application, don't add another one. already_installed_app_index = index; - } else if ([app_path isEqualToString:dmg_app_path_dock]) { + } else if ([app_path isEqualToString:dmg_app_path]) { // If the Dock contains a reference to the application on the disk // image, replace it with a reference to the newly installed // application. However, if the Dock contains a reference to both the @@ -364,7 +355,7 @@ void AddIcon(NSString* installed_path, NSString* dmg_app_path) { } // Set up the new Dock tile. - NSURL* url = [NSURL fileURLWithPath:installed_path_dock]; + NSURL* url = [NSURL fileURLWithPath:installed_path isDirectory:YES]; NSDictionary* url_dict = NSURLCopyDictionary(url); if (!url_dict) { LOG(ERROR) << "couldn't create url_dict"; @@ -380,7 +371,7 @@ void AddIcon(NSString* installed_path, NSString* dmg_app_path) { // Add the new tile to the Dock. [persistent_apps insertObject:new_tile atIndex:app_index]; - [persistent_app_paths insertObject:installed_path_dock atIndex:app_index]; + [persistent_app_paths insertObject:installed_path atIndex:app_index]; made_change = true; } diff --git a/chrome/browser/mac/keystone_glue.mm b/chrome/browser/mac/keystone_glue.mm index 8b00373..4236206 100644 --- a/chrome/browser/mac/keystone_glue.mm +++ b/chrome/browser/mac/keystone_glue.mm @@ -892,6 +892,12 @@ NSString* const kVersionKey = @"KSVersion"; // Upon completion, ksr::KSRegistrationPromotionDidCompleteNotification will // be posted, and -promotionComplete: will be called. + + // If synchronous, see to it that this happens immediately. Give it a + // 10-second deadline. + if (synchronous) { + CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, false); + } } - (void)promotionComplete:(NSNotification*)notification { @@ -910,6 +916,13 @@ NSString* const kVersionKey = @"KSVersion"; authorization_.reset(); [self updateStatus:kAutoupdatePromoteFailed version:nil]; } + + if (synchronousPromotion_) { + // The run loop doesn't need to wait for this any longer. + CFRunLoopRef runLoop = CFRunLoopGetCurrent(); + CFRunLoopStop(runLoop); + CFRunLoopWakeUp(runLoop); + } } - (void)changePermissionsForPromotionAsync { |