Index: chrome/browser/web_applications/web_app.cc |
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc |
index c2b2a3453ff1aa1e3b6f5531c73e451374b92a1d..e7558e5bee8c19bd1b607fbfe850241e00e823c8 100644 |
--- a/chrome/browser/web_applications/web_app.cc |
+++ b/chrome/browser/web_applications/web_app.cc |
@@ -28,6 +28,16 @@ bool IconPrecedes(const WebApplicationInfo::IconInfo& left, |
} |
#endif |
+void DeleteShortcutsOnFileThread( |
+ const ShellIntegration::ShortcutInfo& shortcut_info) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
+ |
+ FilePath shortcut_data_dir = web_app::GetWebAppDataDirectory( |
+ shortcut_info.profile_path, shortcut_info.extension_id, GURL()); |
+ return web_app::internals::DeletePlatformShortcuts( |
+ shortcut_data_dir, shortcut_info); |
+} |
+ |
} // namespace |
namespace web_app { |
@@ -57,6 +67,7 @@ FilePath GetSanitizedFileName(const string16& name) { |
FilePath GetWebAppDataDirectory(const FilePath& profile_path, |
const std::string& extension_id, |
const GURL& url) { |
+ DCHECK(!profile_path.empty()); |
FilePath app_data_dir(profile_path.Append(chrome::kWebAppDirname)); |
if (!extension_id.empty()) { |
@@ -118,38 +129,33 @@ std::string GetExtensionIdFromApplicationName(const std::string& app_name) { |
return app_name.substr(prefix.length()); |
} |
-void CreateShortcut( |
- const FilePath& profile_path, |
- const ShellIntegration::ShortcutInfo& shortcut_info) { |
+void CreateShortcuts(const ShellIntegration::ShortcutInfo& shortcut_info) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
BrowserThread::PostTask( |
BrowserThread::FILE, |
FROM_HERE, |
- base::Bind(base::IgnoreResult(&CreateShortcutOnFileThread), |
- profile_path, shortcut_info)); |
+ base::Bind(base::IgnoreResult(&CreateShortcutsOnFileThread), |
+ shortcut_info)); |
} |
-void DeleteAllShortcuts(const FilePath& profile_path, |
- const std::string& extension_id) { |
+void DeleteAllShortcuts(const ShellIntegration::ShortcutInfo& shortcut_info) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
BrowserThread::PostTask( |
BrowserThread::FILE, |
FROM_HERE, |
- base::Bind(&internals::DeletePlatformShortcuts, profile_path, |
- extension_id)); |
+ base::Bind(&DeleteShortcutsOnFileThread, shortcut_info)); |
} |
-bool CreateShortcutOnFileThread( |
- const FilePath& profile_path, |
+bool CreateShortcutsOnFileThread( |
const ShellIntegration::ShortcutInfo& shortcut_info) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
FilePath shortcut_data_dir = GetWebAppDataDirectory( |
- profile_path, shortcut_info.extension_id, shortcut_info.url); |
- return internals::CreatePlatformShortcut( |
- shortcut_data_dir, profile_path, shortcut_info); |
+ shortcut_info.profile_path, shortcut_info.extension_id, |
+ shortcut_info.url); |
+ return internals::CreatePlatformShortcuts(shortcut_data_dir, shortcut_info); |
} |
bool IsValidUrl(const GURL& url) { |