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

Side by Side Diff: chrome/browser/web_applications/web_app_mac.mm

Issue 9374009: Install platform apps into a separate data directory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/web_applications/web_app_mac.h" 5 #import "chrome/browser/web_applications/web_app_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/mac/bundle_locations.h" 10 #include "base/mac/bundle_locations.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 NSString* substitution = [replacement_dict valueForKey:variable]; 168 NSString* substitution = [replacement_dict valueForKey:variable];
169 if (substitution) 169 if (substitution)
170 [plist setObject:substitution forKey:key]; 170 [plist setObject:substitution forKey:key];
171 } 171 }
172 172
173 // 2. Fill in other values. 173 // 2. Fill in other values.
174 [plist setObject:GetBundleIdentifier(plist) 174 [plist setObject:GetBundleIdentifier(plist)
175 forKey:base::mac::CFToNSCast(kCFBundleIdentifierKey)]; 175 forKey:base::mac::CFToNSCast(kCFBundleIdentifierKey)];
176 [plist setObject:base::mac::FilePathToNSString(data_dir_) 176 [plist setObject:base::mac::FilePathToNSString(data_dir_)
177 forKey:app_mode::kCrAppModeUserDataDirKey]; 177 forKey:app_mode::kCrAppModeUserDataDirKey];
178 [plist setObject:base::mac::FilePathToNSString(info_.extension_path)
179 forKey:app_mode::kCrAppModeExtensionPathKey];
Robert Sesek 2012/02/23 01:23:47 nit: align colons
sail 2012/02/23 04:19:40 Done.
178 180
179 return [plist writeToFile:plist_path atomically:YES]; 181 return [plist writeToFile:plist_path atomically:YES];
180 } 182 }
181 183
182 bool WebAppShortcutCreator::UpdateIcon(const FilePath& app_path) const { 184 bool WebAppShortcutCreator::UpdateIcon(const FilePath& app_path) const {
183 // TODO(sail): Add support for multiple icon sizes. 185 // TODO(sail): Add support for multiple icon sizes.
184 if (info_.favicon.empty() || info_.favicon.width() != 32 || 186 if (info_.favicon.empty() || info_.favicon.width() != 32 ||
185 info_.favicon.height() != 32) { 187 info_.favicon.height() != 32) {
186 return true; 188 return true;
187 } 189 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 const ShellIntegration::ShortcutInfo& shortcut_info) { 241 const ShellIntegration::ShortcutInfo& shortcut_info) {
240 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); 242 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
241 string16 bundle_id = UTF8ToUTF16(base::mac::BaseBundleID()); 243 string16 bundle_id = UTF8ToUTF16(base::mac::BaseBundleID());
242 WebAppShortcutCreator shortcut_creator( 244 WebAppShortcutCreator shortcut_creator(
243 web_app_path, shortcut_info, bundle_id); 245 web_app_path, shortcut_info, bundle_id);
244 shortcut_creator.CreateShortcut(); 246 shortcut_creator.CreateShortcut();
245 } 247 }
246 248
247 } // namespace internals 249 } // namespace internals
248 } // namespace web_app 250 } // namespace web_app
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698