| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 void DeletePlatformShortcuts( | 25 void DeletePlatformShortcuts( |
| 26 const base::FilePath& web_app_path, | 26 const base::FilePath& web_app_path, |
| 27 const ShellIntegration::ShortcutInfo& shortcut_info) { | 27 const ShellIntegration::ShortcutInfo& shortcut_info) { |
| 28 ShellIntegrationLinux::DeleteDesktopShortcuts(shortcut_info.profile_path, | 28 ShellIntegrationLinux::DeleteDesktopShortcuts(shortcut_info.profile_path, |
| 29 shortcut_info.extension_id); | 29 shortcut_info.extension_id); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void UpdatePlatformShortcuts( | 32 void UpdatePlatformShortcuts( |
| 33 const base::FilePath& web_app_path, | 33 const base::FilePath& web_app_path, |
| 34 const string16& /*old_app_title*/, |
| 34 const ShellIntegration::ShortcutInfo& shortcut_info) { | 35 const ShellIntegration::ShortcutInfo& shortcut_info) { |
| 35 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | 36 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
| 36 | 37 |
| 37 scoped_ptr<base::Environment> env(base::Environment::Create()); | 38 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 38 | 39 |
| 39 // Find out whether shortcuts are already installed. | 40 // Find out whether shortcuts are already installed. |
| 40 ShellIntegration::ShortcutLocations creation_locations = | 41 ShellIntegration::ShortcutLocations creation_locations = |
| 41 ShellIntegrationLinux::GetExistingShortcutLocations( | 42 ShellIntegrationLinux::GetExistingShortcutLocations( |
| 42 env.get(), shortcut_info.profile_path, shortcut_info.extension_id); | 43 env.get(), shortcut_info.profile_path, shortcut_info.extension_id); |
| 43 // Always create a hidden shortcut in applications if a visible one is not | 44 // Always create a hidden shortcut in applications if a visible one is not |
| 44 // being created. This allows the operating system to identify the app, but | 45 // being created. This allows the operating system to identify the app, but |
| 45 // not show it in the menu. | 46 // not show it in the menu. |
| 46 creation_locations.hidden = true; | 47 creation_locations.hidden = true; |
| 47 | 48 |
| 48 // Always create the shortcut in the Chrome Apps subdir (even if it is | 49 // Always create the shortcut in the Chrome Apps subdir (even if it is |
| 49 // currently in a different location). | 50 // currently in a different location). |
| 50 creation_locations.applications_menu_subdir = GetAppShortcutsSubdirName(); | 51 creation_locations.applications_menu_subdir = GetAppShortcutsSubdirName(); |
| 51 | 52 |
| 52 CreatePlatformShortcuts(web_app_path, shortcut_info, creation_locations); | 53 CreatePlatformShortcuts(web_app_path, shortcut_info, creation_locations); |
| 53 } | 54 } |
| 54 | 55 |
| 55 } // namespace internals | 56 } // namespace internals |
| 56 | 57 |
| 57 } // namespace web_app | 58 } // namespace web_app |
| OLD | NEW |