summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile.cc
diff options
context:
space:
mode:
authoridanan@chromium.org <idanan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-23 18:02:23 +0000
committeridanan@chromium.org <idanan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-23 18:02:23 +0000
commiteaadd905fd0d3e3e0496f229a5aaa3e3982002a4 (patch)
tree7174b1009f01eb2ee982c1d834c4d052ff916904 /chrome/browser/profile.cc
parentc86d472e35440254cf860f40c40aaaf45992bfdc (diff)
downloadchromium_src-eaadd905fd0d3e3e0496f229a5aaa3e3982002a4.zip
chromium_src-eaadd905fd0d3e3e0496f229a5aaa3e3982002a4.tar.gz
chromium_src-eaadd905fd0d3e3e0496f229a5aaa3e3982002a4.tar.bz2
Privacy Blacklist SketelonAdded code hooks to serve as place holders for the implementationof the privacy blacklist. The --privacy-blacklist option was addedwhich will eventually is used to activate the code.This is work-in-progress code which effectively makes a couple morepointer-checks when the --privacy-blacklist is not specified. Whenit is specified, some of the blacklist code is executed but theblacklist is always empty and therefore has no impact on browsing.
BUG=none TEST=Blacklist* Review URL: http://codereview.chromium.org/119313 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.cc')
-rw-r--r--chrome/browser/profile.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 67e9810..5c9f977 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/history/history.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/password_manager/password_store_default.h"
+#include "chrome/browser/privacy_blacklist/blacklist.h"
#include "chrome/browser/profile_manager.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/search_engines/template_url_fetcher.h"
@@ -273,6 +274,10 @@ class OffTheRecordProfileImpl : public Profile,
return extensions_request_context_;
}
+ virtual Blacklist* GetBlacklist() {
+ return GetOriginalProfile()->GetBlacklist();
+ }
+
virtual SessionService* GetSessionService() {
// Don't save any sessions when off the record.
return NULL;
@@ -414,6 +419,7 @@ ProfileImpl::ProfileImpl(const FilePath& path)
request_context_(NULL),
media_request_context_(NULL),
extensions_request_context_(NULL),
+ blacklist_(NULL),
history_service_created_(false),
created_web_data_service_(false),
created_password_store_(false),
@@ -440,6 +446,18 @@ ProfileImpl::ProfileImpl(const FilePath& path)
personalization_.reset(Personalization::CreateProfilePersonalization(this));
#endif
+ if (CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kPrivacyBlacklist)) {
+ std::wstring option = CommandLine::ForCurrentProcess()->GetSwitchValue(
+ switches::kPrivacyBlacklist);
+#if defined(OS_POSIX)
+ FilePath path(WideToUTF8(option));
+#else
+ FilePath path(option);
+#endif
+ blacklist_ = new Blacklist(path);
+ }
+
#if defined(OS_LINUX)
// TODO(port): Remove ifdef when the Linux splash page is not needed.
prefs->transient()->SetString(prefs::kHomePage, "about:linux-splash");
@@ -549,6 +567,10 @@ ProfileImpl::~ProfileImpl() {
CleanupRequestContext(media_request_context_);
CleanupRequestContext(extensions_request_context_);
+ // When the request contexts are gone, the blacklist wont be needed anymore.
+ delete blacklist_;
+ blacklist_ = 0;
+
// HistoryService may call into the BookmarkModel, as such we need to
// delete HistoryService before the BookmarkModel. The destructor for
// HistoryService will join with HistoryService's backend thread so that
@@ -749,6 +771,10 @@ URLRequestContext* ProfileImpl::GetRequestContextForExtensions() {
return extensions_request_context_;
}
+Blacklist* ProfileImpl::GetBlacklist() {
+ return blacklist_;
+}
+
HistoryService* ProfileImpl::GetHistoryService(ServiceAccessType sat) {
if (!history_service_created_) {
history_service_created_ = true;