fix: clearRecentDocuments role on Windows (#19599)

* fix: clear recent documents on windows

* chore: don't check for version < win 7
This commit is contained in:
Shelley Vohr 2019-08-05 15:11:43 -07:00 committed by GitHub
parent 33a9d898a6
commit f0396c19be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,9 +96,6 @@ void Browser::Focus() {
}
void Browser::AddRecentDocument(const base::FilePath& path) {
if (base::win::GetVersion() < base::win::Version::WIN7)
return;
CComPtr<IShellItem> item;
HRESULT hr = SHCreateItemFromParsingName(path.value().c_str(), NULL,
IID_PPV_ARGS(&item));
@ -111,13 +108,7 @@ 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(GetAppUserModelID())))
return;
destinations->RemoveAllDestinations();
SHAddToRecentDocs(SHARD_APPIDINFO, nullptr);
}
void Browser::SetAppUserModelID(const base::string16& name) {