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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 void AppShortcutManager::Observe(int type, | 63 void AppShortcutManager::Observe(int type, |
64 const content::NotificationSource& source, | 64 const content::NotificationSource& source, |
65 const content::NotificationDetails& details) { | 65 const content::NotificationDetails& details) { |
66 #if !defined(OS_MACOSX) | 66 #if !defined(OS_MACOSX) |
67 switch (type) { | 67 switch (type) { |
68 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { | 68 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { |
69 const Extension* extension = content::Details<const Extension>( | 69 const Extension* extension = content::Details<const Extension>( |
70 details).ptr(); | 70 details).ptr(); |
71 if (extension->is_platform_app() && | 71 if (extension->is_platform_app() && |
72 extension->location() != Extension::COMPONENT) { | 72 extension->location() != Manifest::COMPONENT) { |
73 #if defined(OS_WIN) | 73 #if defined(OS_WIN) |
74 if (BrowserDistribution::GetDistribution()->AppHostIsSupported() && | 74 if (BrowserDistribution::GetDistribution()->AppHostIsSupported() && |
75 extensions::AppHostInstaller::GetInstallWithLauncher()) { | 75 extensions::AppHostInstaller::GetInstallWithLauncher()) { |
76 scoped_refptr<Extension> extension_ref(const_cast<Extension*>( | 76 scoped_refptr<Extension> extension_ref(const_cast<Extension*>( |
77 extension)); | 77 extension)); |
78 extensions::AppHostInstaller::EnsureAppHostInstalled( | 78 extensions::AppHostInstaller::EnsureAppHostInstalled( |
79 base::Bind(&AppShortcutManager::OnAppHostInstallationComplete, | 79 base::Bind(&AppShortcutManager::OnAppHostInstallationComplete, |
80 weak_factory_.GetWeakPtr(), extension_ref)); | 80 weak_factory_.GetWeakPtr(), extension_ref)); |
81 } else { | 81 } else { |
82 UpdateApplicationShortcuts(extension); | 82 UpdateApplicationShortcuts(extension); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 } | 176 } |
177 | 177 |
178 void AppShortcutManager::DeleteApplicationShortcuts( | 178 void AppShortcutManager::DeleteApplicationShortcuts( |
179 const Extension* extension) { | 179 const Extension* extension) { |
180 ShellIntegration::ShortcutInfo delete_info = | 180 ShellIntegration::ShortcutInfo delete_info = |
181 ShortcutInfoForExtensionAndProfile(extension, profile_); | 181 ShortcutInfoForExtensionAndProfile(extension, profile_); |
182 web_app::DeleteAllShortcuts(delete_info); | 182 web_app::DeleteAllShortcuts(delete_info); |
183 } | 183 } |
184 | 184 |
185 } // namespace extensions | 185 } // namespace extensions |
OLD | NEW |