OLD | NEW |
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 #include "chrome/browser/web_applications/web_app.h" | 5 #include "chrome/browser/web_applications/web_app.h" |
6 | 6 |
7 #include "base/environment.h" | 7 #include "base/environment.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/shell_integration_linux.h" |
9 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
10 | 11 |
11 namespace web_app { | 12 namespace web_app { |
12 namespace internals { | 13 namespace internals { |
13 | 14 |
14 void CreateShortcutTask(const FilePath& web_app_path, | 15 bool CreatePlatformShortcut( |
15 const FilePath& profile_path, | 16 const FilePath& web_app_path, |
16 const ShellIntegration::ShortcutInfo& shortcut_info) { | 17 const FilePath& profile_path, |
| 18 const ShellIntegration::ShortcutInfo& shortcut_info) { |
17 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | 19 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
18 | 20 |
19 scoped_ptr<base::Environment> env(base::Environment::Create()); | 21 scoped_ptr<base::Environment> env(base::Environment::Create()); |
20 | 22 |
21 std::string shortcut_template; | 23 std::string shortcut_template; |
22 if (!ShellIntegration::GetDesktopShortcutTemplate(env.get(), | 24 if (!ShellIntegration::GetDesktopShortcutTemplate(env.get(), |
23 &shortcut_template)) { | 25 &shortcut_template)) { |
24 return; | 26 return false; |
25 } | 27 } |
26 ShellIntegration::CreateDesktopShortcut(shortcut_info, shortcut_template); | 28 return ShellIntegrationLinux::CreateDesktopShortcutForChromeApp( |
| 29 shortcut_info, web_app_path, shortcut_template); |
27 } | 30 } |
28 | 31 |
29 } // namespace internals | 32 } // namespace internals |
30 } // namespace web_app | 33 } // namespace web_app |
OLD | NEW |