summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_applications
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/web_applications')
-rw-r--r--chrome/browser/web_applications/web_app.cc14
-rw-r--r--chrome/browser/web_applications/web_app.h11
-rw-r--r--chrome/browser/web_applications/web_app_linux.cc5
-rw-r--r--chrome/browser/web_applications/web_app_mac.mm6
-rw-r--r--chrome/browser/web_applications/web_app_win.cc5
5 files changed, 39 insertions, 2 deletions
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc
index a502b5a..c2b2a34 100644
--- a/chrome/browser/web_applications/web_app.cc
+++ b/chrome/browser/web_applications/web_app.cc
@@ -127,8 +127,18 @@ void CreateShortcut(
BrowserThread::FILE,
FROM_HERE,
base::Bind(base::IgnoreResult(&CreateShortcutOnFileThread),
- profile_path,
- shortcut_info));
+ profile_path, shortcut_info));
+}
+
+void DeleteAllShortcuts(const FilePath& profile_path,
+ const std::string& extension_id) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ BrowserThread::PostTask(
+ BrowserThread::FILE,
+ FROM_HERE,
+ base::Bind(&internals::DeletePlatformShortcuts, profile_path,
+ extension_id));
}
bool CreateShortcutOnFileThread(
diff --git a/chrome/browser/web_applications/web_app.h b/chrome/browser/web_applications/web_app.h
index 253c88f..bcd445a 100644
--- a/chrome/browser/web_applications/web_app.h
+++ b/chrome/browser/web_applications/web_app.h
@@ -54,6 +54,11 @@ void CreateShortcut(
const FilePath& profile_path,
const ShellIntegration::ShortcutInfo& shortcut_info);
+// Delete all the shortcuts that have been created for the extension with
+// |extension_id| in the profile with |profile_path|.
+void DeleteAllShortcuts(const FilePath& profile_path,
+ const std::string& extension_id);
+
// Creates a shortcut. Must be called on the file thread. This is used to
// implement CreateShortcut() above, and can also be used directly from the
// file thread. |profile_path| is the path of the creating profile.
@@ -97,6 +102,12 @@ bool CreatePlatformShortcut(
const FilePath& profile_path,
const ShellIntegration::ShortcutInfo& shortcut_info);
+// Delete all the shortcuts we have added for this extension. This is the
+// platform specific implementation of the DeleteAllShortcuts function, and
+// is executed on the FILE thread..
+void DeletePlatformShortcuts(const FilePath& profile_path,
+ const std::string& extension_id);
+
// Sanitizes |name| and returns a version of it that is safe to use as an
// on-disk file name .
FilePath GetSanitizedFileName(const string16& name);
diff --git a/chrome/browser/web_applications/web_app_linux.cc b/chrome/browser/web_applications/web_app_linux.cc
index e26be43..56d02fbf 100644
--- a/chrome/browser/web_applications/web_app_linux.cc
+++ b/chrome/browser/web_applications/web_app_linux.cc
@@ -29,5 +29,10 @@ bool CreatePlatformShortcut(
shortcut_info, shortcut_template);
}
+void DeletePlatformShortcuts(const FilePath& profile_path,
+ const std::string& extension_id) {
+ ShellIntegrationLinux::DeleteDesktopShortcuts(profile_path, extension_id);
+}
+
} // namespace internals
} // namespace web_app
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index de64f35..e4d22f0 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -262,5 +262,11 @@ bool CreatePlatformShortcut(
return shortcut_creator.CreateShortcut();
}
+void DeletePlatformShortcuts(const FilePath& profile_path,
+ const std::string& extension_id) {
+ // TODO(benwells): Implement this when shortcuts / weblings are enabled on
+ // mac.
+}
+
} // namespace internals
} // namespace web_app
diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc
index f6cbbbf1..f5d85bd 100644
--- a/chrome/browser/web_applications/web_app_win.cc
+++ b/chrome/browser/web_applications/web_app_win.cc
@@ -255,6 +255,11 @@ bool CreatePlatformShortcut(
return success;
}
+void DeletePlatformShortcuts(const FilePath& profile_path,
+ const std::string& extension_id) {
+ // TODO(benwells): Implement this.
+}
+
} // namespace internals
} // namespace web_app