Copy from http://chrome-reviews.prom.corp.google.com/1237 (new gcl changelist model).
Description was:
Conditionally include personalization/ code by surrounding
the hooks into this module with #ifdef CHROME_PERSONALIZATION
in various .h/.cc files.
Building with the module requires adding this macro as a preprocessor
definition in build/internal/essential.vsprops, and adding it to the
VCResourceCompiler tool's command line (using /d). We will try and
make this easier in the future.
TBR=darin
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@955 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 7030785..08d9a0a2 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -502,6 +502,12 @@
return profile_->GetBookmarkBarModel();
}
+#ifdef CHROME_PERSONALIZATION
+ virtual ProfilePersonalization GetProfilePersonalization() {
+ return profile_->GetProfilePersonalization();
+ }
+#endif
+
virtual bool IsSameProfile(Profile* profile) {
if (profile == static_cast<Profile*>(this))
return true;
@@ -575,6 +581,9 @@
create_session_service_task_(this),
start_time_(Time::Now()),
spellchecker_(NULL),
+#ifdef CHROME_PERSONALIZATION
+ personalization_(NULL),
+#endif
shutdown_session_service_(false) {
DCHECK(!path.empty()) << "Using an empty path will attempt to write " <<
"profile files to the root directory!";
@@ -596,6 +605,11 @@
// before the history is shutdown so it can properly cancel all requests.
download_manager_ = NULL;
+#ifdef CHROME_PERSONALIZATION
+ Personalization::CleanupProfilePersonalization(personalization_);
+ personalization_ = NULL;
+#endif
+
// Both HistoryService and WebDataService maintain threads for background
// processing. Its possible each thread still has tasks on it that have
// increased the ref count of the service. In such a situation, when we
@@ -921,3 +935,11 @@
create_session_service_timer_ = NULL;
}
}
+
+#ifdef CHROME_PERSONALIZATION
+ProfilePersonalization ProfileImpl::GetProfilePersonalization() {
+ if (!personalization_)
+ personalization_ = Personalization::CreateProfilePersonalization(this);
+ return personalization_;
+}
+#endif
\ No newline at end of file