| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 const ShortcutInfo& shortcut_info, | 47 const ShortcutInfo& shortcut_info, |
| 48 const extensions::FileHandlersInfo& file_handlers_info) { | 48 const extensions::FileHandlersInfo& file_handlers_info) { |
| 49 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | 49 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
| 50 | 50 |
| 51 scoped_ptr<base::Environment> env(base::Environment::Create()); | 51 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 52 | 52 |
| 53 // Find out whether shortcuts are already installed. | 53 // Find out whether shortcuts are already installed. |
| 54 ShortcutLocations creation_locations = | 54 ShortcutLocations creation_locations = |
| 55 shell_integration_linux::GetExistingShortcutLocations( | 55 shell_integration_linux::GetExistingShortcutLocations( |
| 56 env.get(), shortcut_info.profile_path, shortcut_info.extension_id); | 56 env.get(), shortcut_info.profile_path, shortcut_info.extension_id); |
| 57 |
| 57 // Always create a hidden shortcut in applications if a visible one is not | 58 // Always create a hidden shortcut in applications if a visible one is not |
| 58 // being created. This allows the operating system to identify the app, but | 59 // being created. This allows the operating system to identify the app, but |
| 59 // not show it in the menu. | 60 // not show it in the menu. |
| 60 creation_locations.hidden = true; | 61 if (creation_locations.applications_menu_location == APP_MENU_LOCATION_NONE) |
| 62 creation_locations.applications_menu_location = APP_MENU_LOCATION_HIDDEN; |
| 61 | 63 |
| 62 CreatePlatformShortcuts(web_app_path, | 64 CreatePlatformShortcuts(web_app_path, |
| 63 shortcut_info, | 65 shortcut_info, |
| 64 file_handlers_info, | 66 file_handlers_info, |
| 65 creation_locations, | 67 creation_locations, |
| 66 SHORTCUT_CREATION_BY_USER); | 68 SHORTCUT_CREATION_AUTOMATED); |
| 67 } | 69 } |
| 68 | 70 |
| 69 void DeleteAllShortcutsForProfile(const base::FilePath& profile_path) { | 71 void DeleteAllShortcutsForProfile(const base::FilePath& profile_path) { |
| 70 #if !defined(OS_CHROMEOS) | 72 #if !defined(OS_CHROMEOS) |
| 71 shell_integration_linux::DeleteAllDesktopShortcuts(profile_path); | 73 shell_integration_linux::DeleteAllDesktopShortcuts(profile_path); |
| 72 #endif | 74 #endif |
| 73 } | 75 } |
| 74 | 76 |
| 75 } // namespace internals | 77 } // namespace internals |
| 76 | 78 |
| 77 } // namespace web_app | 79 } // namespace web_app |
| OLD | NEW |