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 "apps/pref_names.h" | 7 #include "apps/pref_names.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 extensions::ExtensionSystem* extension_system; | 136 extensions::ExtensionSystem* extension_system; |
137 ExtensionServiceInterface* extension_service; | 137 ExtensionServiceInterface* extension_service; |
138 if (!(extension_system = extensions::ExtensionSystem::Get(profile_)) || | 138 if (!(extension_system = extensions::ExtensionSystem::Get(profile_)) || |
139 !(extension_service = extension_system->extension_service())) | 139 !(extension_service = extension_system->extension_service())) |
140 return; | 140 return; |
141 | 141 |
142 // Create an applications menu shortcut for each app in this profile. | 142 // Create an applications menu shortcut for each app in this profile. |
143 const ExtensionSet* apps = extension_service->extensions(); | 143 const ExtensionSet* apps = extension_service->extensions(); |
144 for (ExtensionSet::const_iterator it = apps->begin(); | 144 for (ExtensionSet::const_iterator it = apps->begin(); |
145 it != apps->end(); ++it) { | 145 it != apps->end(); ++it) { |
146 if (ShouldCreateShortcutFor(*it)) | 146 if (ShouldCreateShortcutFor(it->get())) |
147 web_app::UpdateShortcutInfoAndIconForApp( | 147 web_app::UpdateShortcutInfoAndIconForApp( |
148 *(*it), profile_, base::Bind(&CreateShortcutsInApplicationsMenu)); | 148 *it->get(), profile_, base::Bind(&CreateShortcutsInApplicationsMenu)); |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 void ShortcutManager::DeleteApplicationShortcuts( | 152 void ShortcutManager::DeleteApplicationShortcuts( |
153 const Extension* extension) { | 153 const Extension* extension) { |
154 ShellIntegration::ShortcutInfo delete_info = | 154 ShellIntegration::ShortcutInfo delete_info = |
155 web_app::ShortcutInfoForExtensionAndProfile(extension, profile_); | 155 web_app::ShortcutInfoForExtensionAndProfile(extension, profile_); |
156 web_app::DeleteAllShortcuts(delete_info); | 156 web_app::DeleteAllShortcuts(delete_info); |
157 } | 157 } |
158 | 158 |
159 } // namespace apps | 159 } // namespace apps |
OLD | NEW |