From 3a453fa1f16dfa4168e52790e329148366abb05f Mon Sep 17 00:00:00 2001 From: "timsteele@google.com" Date: Fri, 15 Aug 2008 18:46:34 +0000 Subject: 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 --- chrome/browser/render_view_host.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'chrome/browser/render_view_host.cc') 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()->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); } -- cgit v1.1