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

Side by Side Diff: chrome/browser/ui/web_applications/web_app_ui.cc

Issue 9423048: Add user data dir field to Mac platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build 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
« no previous file with comments | « chrome/app/chrome_main_app_mode_mac.mm ('k') | chrome/browser/web_applications/web_app.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/ui/web_applications/web_app_ui.h" 5 #include "chrome/browser/ui/web_applications/web_app_ui.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 void UpdateShortcutWorker::UpdateShortcuts() { 222 void UpdateShortcutWorker::UpdateShortcuts() {
223 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 223 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
224 base::Bind(&UpdateShortcutWorker::UpdateShortcutsOnFileThread, 224 base::Bind(&UpdateShortcutWorker::UpdateShortcutsOnFileThread,
225 base::Unretained(this))); 225 base::Unretained(this)));
226 } 226 }
227 227
228 void UpdateShortcutWorker::UpdateShortcutsOnFileThread() { 228 void UpdateShortcutWorker::UpdateShortcutsOnFileThread() {
229 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 229 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
230 230
231 FilePath web_app_path = web_app::internals::GetWebAppDataDirectory( 231 FilePath web_app_path = web_app::GetWebAppDataDirectory(
232 web_app::GetDataDir(profile_path_), shortcut_info_); 232 profile_path_, shortcut_info_.extension_id, shortcut_info_.url);
233 233
234 // Ensure web_app_path exists. web_app_path could be missing for a legacy 234 // Ensure web_app_path exists. web_app_path could be missing for a legacy
235 // shortcut created by Gears. 235 // shortcut created by Gears.
236 if (!file_util::PathExists(web_app_path) && 236 if (!file_util::PathExists(web_app_path) &&
237 !file_util::CreateDirectory(web_app_path)) { 237 !file_util::CreateDirectory(web_app_path)) {
238 NOTREACHED(); 238 NOTREACHED();
239 return; 239 return;
240 } 240 }
241 241
242 FilePath icon_file = web_app_path.Append(file_name_).ReplaceExtension( 242 FilePath icon_file = web_app_path.Append(file_name_).ReplaceExtension(
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 314
315 void UpdateShortcutForTabContents(TabContentsWrapper* tab_contents) { 315 void UpdateShortcutForTabContents(TabContentsWrapper* tab_contents) {
316 #if defined(OS_WIN) 316 #if defined(OS_WIN)
317 // UpdateShortcutWorker will delete itself when it's done. 317 // UpdateShortcutWorker will delete itself when it's done.
318 UpdateShortcutWorker* worker = new UpdateShortcutWorker(tab_contents); 318 UpdateShortcutWorker* worker = new UpdateShortcutWorker(tab_contents);
319 worker->Run(); 319 worker->Run();
320 #endif // defined(OS_WIN) 320 #endif // defined(OS_WIN)
321 } 321 }
322 322
323 } // namespace web_app 323 } // namespace web_app
OLDNEW
« no previous file with comments | « chrome/app/chrome_main_app_mode_mac.mm ('k') | chrome/browser/web_applications/web_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698