summaryrefslogtreecommitdiffstats
path: root/chrome/browser/render_view_host.cc
diff options
context:
space:
mode:
authortimsteele@google.com <timsteele@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 18:46:34 +0000
committertimsteele@google.com <timsteele@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 18:46:34 +0000
commit3a453fa1f16dfa4168e52790e329148366abb05f (patch)
treea8bbab89ec883a838600e0b63d92fad4361e5dfb /chrome/browser/render_view_host.cc
parent173de1be12780200c62bae5c01965d51ac0eaa31 (diff)
downloadchromium_src-3a453fa1f16dfa4168e52790e329148366abb05f.zip
chromium_src-3a453fa1f16dfa4168e52790e329148366abb05f.tar.gz
chromium_src-3a453fa1f16dfa4168e52790e329148366abb05f.tar.bz2
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
Diffstat (limited to 'chrome/browser/render_view_host.cc')
-rw-r--r--chrome/browser/render_view_host.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/render_view_host.cc b/chrome/browser/render_view_host.cc
index 7e9dd5e..0b84911 100644
--- a/chrome/browser/render_view_host.cc
+++ b/chrome/browser/render_view_host.cc
@@ -117,11 +117,19 @@ RenderViewHost::RenderViewHost(SiteInstance* instance,
modal_dialog_event = CreateEvent(NULL, TRUE, FALSE, NULL);
modal_dialog_event_.Set(modal_dialog_event);
+#ifdef CHROME_PERSONALIZATION
+ personalization_ = Personalization::CreateHostPersonalization(this);
+#endif
}
RenderViewHost::~RenderViewHost() {
OnDebugDisconnect();
+#ifdef CHROME_PERSONALIZATION
+ Personalization::CleanupHostPersonalization(personalization_);
+ personalization_ = NULL;
+#endif
+
// Be sure to clean up any leftover state from cross-site requests.
Singleton<CrossSiteRequestManager>()->SetHasPendingCrossSiteRequest(
process()->host_id(), routing_id_, false);
@@ -657,6 +665,10 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
OnMsgDomOperationResponse)
IPC_MESSAGE_HANDLER(ViewHostMsg_DOMUISend,
OnMsgDOMUISend)
+#ifdef CHROME_PERSONALIZATION
+ IPC_MESSAGE_HANDLER(ViewHostMsg_PersonalizationEvent,
+ OnPersonalizationEvent)
+#endif
IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset,
OnMsgGoToEntryAtOffset)
IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnMsgSetTooltipText)
@@ -1001,6 +1013,13 @@ void RenderViewHost::OnMsgDOMUISend(
delegate_->ProcessDOMUIMessage(message, content);
}
+#ifdef CHROME_PERSONALIZATION
+void RenderViewHost::OnPersonalizationEvent(const std::string& message,
+ const std::string& content) {
+ Personalization::HandlePersonalizationEvent(this, message, content);
+}
+#endif
+
void RenderViewHost::OnMsgGoToEntryAtOffset(int offset) {
delegate_->GoToEntryAtOffset(offset);
}