win: Add app.clearRecentDocuments API

This commit is contained in:
Cheng Zhao 2014-11-17 16:13:47 +08:00
parent 528f7bd45f
commit 48412769df
5 changed files with 21 additions and 0 deletions

View file

@ -59,6 +59,16 @@ void Browser::AddRecentDocument(const base::FilePath& path) {
}
}
void Browser::ClearRecentDocuments() {
CComPtr<IApplicationDestinations> destinations;
if (FAILED(destinations.CoCreateInstance(CLSID_ApplicationDestinations,
NULL, CLSCTX_INPROC_SERVER)))
return;
if (FAILED(destinations->SetAppID(app_user_model_id_.c_str())))
return;
destinations->RemoveAllDestinations();
}
void Browser::SetAppUserModelID(const std::string& name) {
app_user_model_id_ = base::UTF8ToUTF16(
base::StringPrintf("atom-shell.app.%s", name));