From f0396c19be63d0e73cfc69867accffe2bd0d9dad Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 5 Aug 2019 15:11:43 -0700 Subject: [PATCH] fix: clearRecentDocuments role on Windows (#19599) * fix: clear recent documents on windows * chore: don't check for version < win 7 --- shell/browser/browser_win.cc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/shell/browser/browser_win.cc b/shell/browser/browser_win.cc index dbf22c2ff053..28aac9922fe4 100644 --- a/shell/browser/browser_win.cc +++ b/shell/browser/browser_win.cc @@ -96,9 +96,6 @@ void Browser::Focus() { } void Browser::AddRecentDocument(const base::FilePath& path) { - if (base::win::GetVersion() < base::win::Version::WIN7) - return; - CComPtr 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 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) {