summaryrefslogtreecommitdiffstats
path: root/chrome_frame/utils.cc
diff options
context:
space:
mode:
authorslightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 22:30:03 +0000
committerslightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 22:30:03 +0000
commitb1208f04eb82316e5d84f4a3115c52ae55b845a9 (patch)
tree4382a9152193149dcea630bcbfc3705f19d7c7cd /chrome_frame/utils.cc
parent4fdb9c6bc7cb6f38b951f8255fca0df9794196f4 (diff)
downloadchromium_src-b1208f04eb82316e5d84f4a3115c52ae55b845a9.zip
chromium_src-b1208f04eb82316e5d84f4a3115c52ae55b845a9.tar.gz
chromium_src-b1208f04eb82316e5d84f4a3115c52ae55b845a9.tar.bz2
Implements IDeleteBrowsing history and moves the GCF profile into the IE TIF directory for non-priv mode users on IE < 8.
Implementation notes: Earlier work enabled InPrivate browsing detection and mapped it to creation of an incognito profile instance.Privacy features and how they operate with this change: "Delete Browsing History": IE 6 & 7: all history (including databases) is deleted if cache is cleared *WITHOUT* an active Chrome process holding references to the profile resources. If GCF is rendering a page when the cache is cleared, history *WILL NOT* be deleted on the GCF side, however GCF will continue to operate and IE will remove all other history artifacts as usual. IE 8: GCF cache is cleared in alignment with the options specified by the user. Clearing Temporary Internet Files may destroy the profile entirely, and so we need to consider not moving the GCF profile on IE 8. "InPrivate Filtering": IE 8 (only): more testing required. "InPrivate Browsing": IE 8 (only): pages rendered in GCF *after* entering InPrivate mode are not persisted to disk (use an incognito wrapper on the specified profile). Currently displayed pages are not effected by the switch, although refreshing them will invoke the new behavior. Generally speaking, BHO's are disabled by IE 8 while in InPrivate mode, so entering this state is wonky to begin with but we handle it as well as can be expected. BUG=22846 TEST=On IE 8, clear the cache entirely, note GCF entries in DbgView (better tests coming) Review URL: http://codereview.chromium.org/858003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42684 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.cc')
-rw-r--r--chrome_frame/utils.cc29
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;