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 "apps/shortcut_manager.h" | 5 #include "apps/shortcut_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "chrome/browser/shell_integration.h" | 9 #include "chrome/browser/shell_integration.h" |
10 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 10 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
11 #include "chrome/browser/web_applications/web_app.h" | 11 #include "chrome/browser/web_applications/web_app.h" |
12 #include "chrome/common/chrome_notification_types.h" | 12 #include "chrome/common/chrome_notification_types.h" |
13 #include "content/public/browser/notification_details.h" | 13 #include "content/public/browser/notification_details.h" |
14 #include "content/public/browser/notification_source.h" | 14 #include "content/public/browser/notification_source.h" |
15 | 15 |
16 using extensions::Extension; | 16 using extensions::Extension; |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Creates a shortcut for an application in the applications menu. | 20 // Creates a shortcut for an application in the applications menu. |
21 void CreateShortcutsInApplicationsMenu( | 21 void CreateShortcutsInApplicationsMenu( |
22 const ShellIntegration::ShortcutInfo& shortcut_info) { | 22 const ShellIntegration::ShortcutInfo& shortcut_info) { |
23 ShellIntegration::ShortcutLocations creation_locations; | 23 ShellIntegration::ShortcutLocations creation_locations; |
24 creation_locations.in_applications_menu = true; | 24 creation_locations.in_applications_menu = true; |
25 // Create the shortcut in the Chrome Apps subdir. | 25 // Create the shortcut in the Chrome Apps subdir. |
26 creation_locations.applications_menu_subdir = | 26 creation_locations.in_applications_menu_chrome_apps_subdir = true; |
27 web_app::GetAppShortcutsSubdirName(); | |
28 web_app::CreateShortcuts(shortcut_info, creation_locations); | 27 web_app::CreateShortcuts(shortcut_info, creation_locations); |
29 } | 28 } |
30 | 29 |
31 } // namespace | 30 } // namespace |
32 | 31 |
33 namespace apps { | 32 namespace apps { |
34 | 33 |
35 ShortcutManager::ShortcutManager(Profile* profile) | 34 ShortcutManager::ShortcutManager(Profile* profile) |
36 : profile_(profile), | 35 : profile_(profile), |
37 weak_factory_(this) { | 36 weak_factory_(this) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 83 } |
85 | 84 |
86 void ShortcutManager::DeleteApplicationShortcuts( | 85 void ShortcutManager::DeleteApplicationShortcuts( |
87 const Extension* extension) { | 86 const Extension* extension) { |
88 ShellIntegration::ShortcutInfo delete_info = | 87 ShellIntegration::ShortcutInfo delete_info = |
89 web_app::ShortcutInfoForExtensionAndProfile(extension, profile_); | 88 web_app::ShortcutInfoForExtensionAndProfile(extension, profile_); |
90 web_app::DeleteAllShortcuts(delete_info); | 89 web_app::DeleteAllShortcuts(delete_info); |
91 } | 90 } |
92 | 91 |
93 } // namespace apps | 92 } // namespace apps |
OLD | NEW |