summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_applications
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 18:50:11 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 18:50:11 +0000
commit710f3001c74fd8d207e503eede551a2c97e9669d (patch)
tree578cc37d42307748794a654c9ab3a288fb002cf6 /chrome/browser/web_applications
parent5edbf8d2dd9f058f00c14c1f485113247c6673a5 (diff)
downloadchromium_src-710f3001c74fd8d207e503eede551a2c97e9669d.zip
chromium_src-710f3001c74fd8d207e503eede551a2c97e9669d.tar.gz
chromium_src-710f3001c74fd8d207e503eede551a2c97e9669d.tar.bz2
Update/repair legacy gears web app shortcuts
r34332 has a bug that web app data dir could be missing for legacy gears shortcut. The fix is to make sure the data dir exists. BUG=8539 TEST=Create a legacy gears web app shortcuts and then update to a version with this fix and launching chrome should update the shortcuts with new icon locations. Review URL: http://codereview.chromium.org/551008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36146 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_applications')
-rw-r--r--chrome/browser/web_applications/web_app.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc
index d09db36..192c04d 100644
--- a/chrome/browser/web_applications/web_app.cc
+++ b/chrome/browser/web_applications/web_app.cc
@@ -576,6 +576,15 @@ void UpdateShortcutWorker::UpdateShortcutsOnFileThread() {
FilePath web_app_path = GetWebAppDataDirectory(
web_app::GetDataDir(profile_path_), shortcut_info_.url);
+
+ // Ensure web_app_path exists. web_app_path could be missing for a legacy
+ // shortcut created by gears.
+ if (!file_util::PathExists(web_app_path) &&
+ !file_util::CreateDirectory(web_app_path)) {
+ NOTREACHED();
+ return;
+ }
+
FilePath icon_file = web_app_path.Append(file_name_).ReplaceExtension(
FILE_PATH_LITERAL(".ico"));
CheckAndSaveIcon(icon_file, shortcut_info_.favicon);