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

Unified Diff: chrome/browser/web_applications/web_app_win.cc

Issue 9958006: Create Linux platform app shortcuts to run in their own process. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Create updated shortcuts from NTP, add enable flag Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/web_applications/web_app_win.cc
diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc
index 97086c9043a5bd0ec318c23fb6f8bb22850acd8f..82349546dbbe4a538a259e6bef281462e2a78b2d 100644
--- a/chrome/browser/web_applications/web_app_win.cc
+++ b/chrome/browser/web_applications/web_app_win.cc
@@ -92,9 +92,10 @@ bool CheckAndSaveIcon(const FilePath& icon_file, const SkBitmap& image) {
return true;
}
-void CreateShortcutTask(const FilePath& web_app_path,
- const FilePath& profile_path,
- const ShellIntegration::ShortcutInfo& shortcut_info) {
+bool CreatePlatformShortcut(
+ const FilePath& web_app_path,
+ const FilePath& profile_path,
+ const ShellIntegration::ShortcutInfo& shortcut_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
// Shortcut paths under which to create shortcuts.
@@ -135,7 +136,7 @@ void CreateShortcutTask(const FilePath& web_app_path,
continue;
if (!PathService::Get(locations[i].location_id, &path)) {
- return;
+ return false;
}
if (locations[i].sub_dir != NULL)
@@ -158,13 +159,7 @@ void CreateShortcutTask(const FilePath& web_app_path,
}
if (shortcut_paths.empty()) {
- return;
- }
-
- // Ensure web_app_path exists.
- if (!file_util::PathExists(web_app_path) &&
- !file_util::CreateDirectory(web_app_path)) {
- return;
+ return false;
}
// Generates file name to use with persisted ico and shortcut file.
@@ -176,12 +171,12 @@ void CreateShortcutTask(const FilePath& web_app_path,
FILE_PATH_LITERAL(".ico"));
if (!web_app::internals::CheckAndSaveIcon(icon_file,
*shortcut_info.favicon.ToSkBitmap())) {
- return;
+ return false;
}
FilePath chrome_exe;
if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
- return;
+ return false;
}
// Working directory.
@@ -251,6 +246,8 @@ void CreateShortcutTask(const FilePath& web_app_path,
success = false;
}
}
+
+ return success;
}
} // namespace internals
« chrome/browser/web_applications/web_app.cc ('K') | « chrome/browser/web_applications/web_app_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698