diff options
author | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-13 06:46:34 +0000 |
---|---|---|
committer | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-13 06:46:34 +0000 |
commit | 8806d3bc0b213bac2a6e6cd6f53682fe92f56177 (patch) | |
tree | 2cb7ab2dad11247aa60c15a391d0e6b7945603e0 /chrome/browser/web_applications/web_app_win.cc | |
parent | fe47cccdeb21b1724c52d2e7d914be8fd2614812 (diff) | |
download | chromium_src-8806d3bc0b213bac2a6e6cd6f53682fe92f56177.zip chromium_src-8806d3bc0b213bac2a6e6cd6f53682fe92f56177.tar.gz chromium_src-8806d3bc0b213bac2a6e6cd6f53682fe92f56177.tar.bz2 |
Create Linux platform app shortcuts to run in their own process.
This change also reorganises the web_app::CreateShortcut code a bit to
allow us to do this without losing any functionality on gtk. Specifically
the ability to create a shortcut on the file thread and get a return value
is still available for Linux, and goes through the web_app code path.
Some of the variable names and comments in web_app.h were also updated
to be clearer.
BUG=None.
TEST=Test that shortcut creation works on Linux, both for platform apps and
normal hosted apps.
Review URL: http://codereview.chromium.org/9958006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132151 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_applications/web_app_win.cc')
-rw-r--r-- | chrome/browser/web_applications/web_app_win.cc | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc index 5a99442..6169c0c 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. @@ -253,6 +248,8 @@ void CreateShortcutTask(const FilePath& web_app_path, success = false; } } + + return success; } } // namespace internals |