| 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 "chrome/browser/shell_integration_linux.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 void DeletePlatformShortcuts( | 33 void DeletePlatformShortcuts( |
| 34 const base::FilePath& web_app_path, | 34 const base::FilePath& web_app_path, |
| 35 const ShellIntegration::ShortcutInfo& shortcut_info) { | 35 const ShellIntegration::ShortcutInfo& shortcut_info) { |
| 36 ShellIntegrationLinux::DeleteDesktopShortcuts(shortcut_info.profile_path, | 36 ShellIntegrationLinux::DeleteDesktopShortcuts(shortcut_info.profile_path, |
| 37 shortcut_info.extension_id); | 37 shortcut_info.extension_id); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void UpdatePlatformShortcuts( | 40 void UpdatePlatformShortcuts( |
| 41 const base::FilePath& web_app_path, | 41 const base::FilePath& web_app_path, |
| 42 const ShellIntegration::ShortcutInfo& shortcut_info) { | 42 const ShellIntegration::ShortcutInfo& shortcut_info) { |
| 43 // TODO(benwells): Implement this. | 43 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
| 44 |
| 45 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 46 |
| 47 // Find out whether shortcuts are already installed. |
| 48 ShellIntegration::ShortcutLocations creation_locations = |
| 49 ShellIntegrationLinux::GetExistingShortcutLocations( |
| 50 env.get(), shortcut_info.profile_path, shortcut_info.extension_id); |
| 51 // Always create a hidden shortcut in applications if a visible one is not |
| 52 // being created. This allows the operating system to identify the app, but |
| 53 // not show it in the menu. |
| 54 creation_locations.hidden = true; |
| 55 |
| 56 CreatePlatformShortcuts(web_app_path, shortcut_info, creation_locations); |
| 44 } | 57 } |
| 45 | 58 |
| 46 } // namespace internals | 59 } // namespace internals |
| 47 | 60 |
| 48 } // namespace web_app | 61 } // namespace web_app |
| OLD | NEW |