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

Side by Side Diff: chrome/browser/cocoa/keystone_glue.mm

Issue 2791001: Take Keystone keys out of the framework's Info.plist (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/platform_util_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/cocoa/keystone_glue.h" 5 #import "chrome/browser/cocoa/keystone_glue.h"
6 6
7 #include <sys/param.h> 7 #include <sys/param.h>
8 #include <sys/mount.h> 8 #include <sys/mount.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 [appPath_ release]; 240 [appPath_ release];
241 [url_ release]; 241 [url_ release];
242 [version_ release]; 242 [version_ release];
243 [channel_ release]; 243 [channel_ release];
244 [registration_ release]; 244 [registration_ release];
245 [[NSNotificationCenter defaultCenter] removeObserver:self]; 245 [[NSNotificationCenter defaultCenter] removeObserver:self];
246 [super dealloc]; 246 [super dealloc];
247 } 247 }
248 248
249 - (NSDictionary*)infoDictionary { 249 - (NSDictionary*)infoDictionary {
250 // Use mac_util::MainAppBundle() to get the app framework's dictionary.
251 return [mac_util::MainAppBundle() infoDictionary];
252 }
253
254 - (void)loadParameters {
255 NSDictionary* infoDictionary = [self infoDictionary];
256
257 // Use [NSBundle mainBundle] to get the application's own bundle identifier 250 // Use [NSBundle mainBundle] to get the application's own bundle identifier
258 // and path, not the framework's. For auto-update, the application is 251 // and path, not the framework's. For auto-update, the application is
259 // what's significant here: it's used to locate the outermost part of the 252 // what's significant here: it's used to locate the outermost part of the
260 // application for the existence checker and other operations that need to 253 // application for the existence checker and other operations that need to
261 // see the entire application bundle. 254 // see the entire application bundle.
255 return [[NSBundle mainBundle] infoDictionary];
256 }
257
258 - (void)loadParameters {
262 NSBundle* appBundle = [NSBundle mainBundle]; 259 NSBundle* appBundle = [NSBundle mainBundle];
260 NSDictionary* infoDictionary = [self infoDictionary];
263 261
264 NSString* productID = [infoDictionary objectForKey:@"KSProductID"]; 262 NSString* productID = [infoDictionary objectForKey:@"KSProductID"];
265 if (productID == nil) { 263 if (productID == nil) {
266 productID = [appBundle bundleIdentifier]; 264 productID = [appBundle bundleIdentifier];
267 } 265 }
268 266
269 NSString* appPath = [appBundle bundlePath]; 267 NSString* appPath = [appBundle bundlePath];
270 NSString* url = [infoDictionary objectForKey:@"KSUpdateURL"]; 268 NSString* url = [infoDictionary objectForKey:@"KSUpdateURL"];
271 NSString* version = [infoDictionary objectForKey:@"KSVersion"]; 269 NSString* version = [infoDictionary objectForKey:@"KSVersion"];
272 270
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 } 890 }
893 891
894 - (void)setAppPath:(NSString*)appPath { 892 - (void)setAppPath:(NSString*)appPath {
895 if (appPath != appPath_) { 893 if (appPath != appPath_) {
896 [appPath_ release]; 894 [appPath_ release];
897 appPath_ = [appPath copy]; 895 appPath_ = [appPath copy];
898 } 896 }
899 } 897 }
900 898
901 @end // @implementation KeystoneGlue 899 @end // @implementation KeystoneGlue
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/platform_util_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698