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/extensions/app_shortcut_manager.h" | 5 #include "chrome/browser/extensions/app_shortcut_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 void AppShortcutManager::Observe(int type, | 83 void AppShortcutManager::Observe(int type, |
84 const content::NotificationSource& source, | 84 const content::NotificationSource& source, |
85 const content::NotificationDetails& details) { | 85 const content::NotificationDetails& details) { |
86 #if !defined(OS_MACOSX) | 86 #if !defined(OS_MACOSX) |
87 switch (type) { | 87 switch (type) { |
88 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { | 88 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { |
89 const Extension* extension = content::Details<const Extension>( | 89 const Extension* extension = content::Details<const Extension>( |
90 details).ptr(); | 90 details).ptr(); |
91 if (extension->is_platform_app()) { | 91 if (extension->is_platform_app() && |
| 92 extension->location() != Extension::COMPONENT) { |
92 #if defined(OS_WIN) | 93 #if defined(OS_WIN) |
93 if (BrowserDistribution::GetDistribution()->AppHostIsSupported()) { | 94 if (BrowserDistribution::GetDistribution()->AppHostIsSupported()) { |
94 scoped_refptr<Extension> extension_ref(const_cast<Extension*>( | 95 scoped_refptr<Extension> extension_ref(const_cast<Extension*>( |
95 extension)); | 96 extension)); |
96 extensions::AppHostInstaller::EnsureAppHostInstalled( | 97 extensions::AppHostInstaller::EnsureAppHostInstalled( |
97 base::Bind(&AppShortcutManager::OnAppHostInstallationComplete, | 98 base::Bind(&AppShortcutManager::OnAppHostInstallationComplete, |
98 weak_factory_.GetWeakPtr(), extension_ref)); | 99 weak_factory_.GetWeakPtr(), extension_ref)); |
99 } else { | 100 } else { |
100 UpdateApplicationShortcuts(extension); | 101 UpdateApplicationShortcuts(extension); |
101 } | 102 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 } | 175 } |
175 | 176 |
176 void AppShortcutManager::DeleteApplicationShortcuts( | 177 void AppShortcutManager::DeleteApplicationShortcuts( |
177 const Extension* extension) { | 178 const Extension* extension) { |
178 ShellIntegration::ShortcutInfo delete_info = | 179 ShellIntegration::ShortcutInfo delete_info = |
179 ShortcutInfoForExtensionAndProfile(extension, profile_); | 180 ShortcutInfoForExtensionAndProfile(extension, profile_); |
180 web_app::DeleteAllShortcuts(delete_info); | 181 web_app::DeleteAllShortcuts(delete_info); |
181 } | 182 } |
182 | 183 |
183 } // namespace extensions | 184 } // namespace extensions |
OLD | NEW |