diff options
author | slightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 04:16:20 +0000 |
---|---|---|
committer | slightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 04:16:20 +0000 |
commit | bc73b4e541f57b44ac4c53df2589d91549f27eaf (patch) | |
tree | 47cf0721b0f9d9cd0a9c83196d4091120300f3a4 /chrome_frame/utils.cc | |
parent | 46215d5ef32784db5544fc5f7ba06b6617935fec (diff) | |
download | chromium_src-bc73b4e541f57b44ac4c53df2589d91549f27eaf.zip chromium_src-bc73b4e541f57b44ac4c53df2589d91549f27eaf.tar.gz chromium_src-bc73b4e541f57b44ac4c53df2589d91549f27eaf.tar.bz2 |
3rd try. *sigh*
See: http://codereview.chromium.org/858003
TBR=tommi
BUG=22846
TEST=On IE 8, clear the cache entirely, watch GCF launch (via task manager)
Review URL: http://codereview.chromium.org/1343004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42732 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.cc')
-rw-r--r-- | chrome_frame/utils.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 7fcdde8..85d4880 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -13,6 +13,7 @@ #include "base/logging.h" #include "base/path_service.h" #include "base/registry.h" +#include "base/scoped_bstr_win.h" #include "base/scoped_comptr_win.h" #include "base/scoped_variant_win.h" #include "base/string_util.h" @@ -411,6 +412,34 @@ IEVersion GetIEVersion() { return ie_version; } +FilePath GetIETemporaryFilesFolder() { + DCHECK_EQ(BROWSER_IE, GetBrowserType()); + + LPITEMIDLIST tif_pidl = NULL; + HRESULT hr = SHGetFolderLocation(NULL, CSIDL_INTERNET_CACHE, NULL, + SHGFP_TYPE_CURRENT, &tif_pidl); + DCHECK(SUCCEEDED(hr) && tif_pidl); + + ScopedComPtr<IShellFolder> parent_folder; + LPCITEMIDLIST relative_pidl = NULL; + hr = SHBindToParent(tif_pidl, IID_IShellFolder, + reinterpret_cast<void**>(parent_folder.Receive()), + &relative_pidl); + DCHECK(SUCCEEDED(hr) && relative_pidl); + + STRRET path = {0}; + hr = parent_folder->GetDisplayNameOf(relative_pidl, + SHGDN_NORMAL | SHGDN_FORPARSING, + &path); + DCHECK(SUCCEEDED(hr)); + ScopedBstr tif_bstr; + StrRetToBSTR(&path, relative_pidl, tif_bstr.Receive()); + FilePath tif(static_cast<BSTR>(tif_bstr)); + + ILFree(tif_pidl); + return tif; +} + bool IsIEInPrivate() { typedef BOOL (WINAPI* IEIsInPrivateBrowsingPtr)(); bool incognito_mode = false; |