summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authorbenwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-11 06:41:50 +0000
committerbenwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-11 06:41:50 +0000
commit30cdf3af7e307e5334895b439ea63c29025f7650 (patch)
treec7e9d81dc6d214737b894296a5356eb9b7875dbe /chrome/browser/extensions
parent914636612ba4bf032b809e1dcf09a11f87384515 (diff)
downloadchromium_src-30cdf3af7e307e5334895b439ea63c29025f7650.zip
chromium_src-30cdf3af7e307e5334895b439ea63c29025f7650.tar.gz
chromium_src-30cdf3af7e307e5334895b439ea63c29025f7650.tar.bz2
Revert 146065 - Remove app shortcuts when app is uninstalled on Linux.
To support this, shortcut creation on Linux for extensions has been modified so that the filename encodes the extension ID and the profile. Also, when creating shortcuts any existing shortcuts are removed first. Web page shortcuts are not affected. BUG=130456 TEST=Test uninstalling apps removes their shortcuts; test uninstalling apps is not broken in any way; test shortcuts for web apps are not broken in any way. Review URL: https://chromiumcodereview.appspot.com/10698114 TBR=benwells@chromium.org Review URL: https://chromiumcodereview.appspot.com/10735048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146066 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/app_shortcut_manager.cc33
1 files changed, 9 insertions, 24 deletions
diff --git a/chrome/browser/extensions/app_shortcut_manager.cc b/chrome/browser/extensions/app_shortcut_manager.cc
index a3357f8..53aba19 100644
--- a/chrome/browser/extensions/app_shortcut_manager.cc
+++ b/chrome/browser/extensions/app_shortcut_manager.cc
@@ -36,8 +36,6 @@ AppShortcutManager::AppShortcutManager(Profile* profile)
tracker_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED,
content::Source<Profile>(profile_));
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
- content::Source<Profile>(profile_));
}
void AppShortcutManager::OnImageLoaded(const gfx::Image& image,
@@ -63,28 +61,15 @@ void AppShortcutManager::OnImageLoaded(const gfx::Image& image,
void AppShortcutManager::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
-#if !defined(OS_MACOSX)
- switch (type) {
- case chrome::NOTIFICATION_EXTENSION_INSTALLED: {
- const Extension* extension = content::Details<const Extension>(
- details).ptr();
- if (!disable_shortcut_creation_for_tests &&
- extension->is_platform_app() &&
- extension->location() != Extension::LOAD) {
- InstallApplicationShortcuts(extension);
- }
- break;
- }
- case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: {
- std::string extension_id = *content::Details<std::string>(details).ptr();
- if (!disable_shortcut_creation_for_tests)
- web_app::DeleteAllShortcuts(profile_->GetPath(), extension_id);
- break;
- }
- default:
- NOTREACHED();
- }
-#endif
+ DCHECK(type == chrome::NOTIFICATION_EXTENSION_INSTALLED);
+ #if !defined(OS_MACOSX)
+ const Extension* extension = content::Details<const Extension>(
+ details).ptr();
+ if (!disable_shortcut_creation_for_tests &&
+ extension->is_platform_app() &&
+ extension->location() != Extension::LOAD)
+ InstallApplicationShortcuts(extension);
+ #endif
}
// static