From 9f1f1fcf77bf3e1a3073f35706efe8b739c0d5ae Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Thu, 27 Jan 2011 19:41:22 +0000 Subject: Move the handling of Desktop notification IPCs coming in from the renderer into a helper object DesktopNotificationHandler whose lifetype is dependent on the TabContents which instantiates it. This object implements the WebNavigationObserver interface which enables it to handle IPCs on the UI thread. The DeskopNotificationHandler object is also instantiated by the ExtensionHost object as it expects the desktop notification IPC's to be handled. I also changed the desktop notification IPCs to carry the routing id as an additional parameter as the notification handling in the browser needs the routing id. BUG=70690 TEST=no change in functionality. Review URL: http://codereview.chromium.org/6340017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72861 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/tab_contents/tab_contents.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'chrome/browser/tab_contents/tab_contents.cc') diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 2554daa..a722215 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -25,6 +25,7 @@ #include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/debugger/devtools_manager.h" #include "chrome/browser/defaults.h" +#include "chrome/browser/desktop_notification_handler.h" #include "chrome/browser/dom_operation_notification_details.h" #include "chrome/browser/dom_ui/dom_ui.h" #include "chrome/browser/download/download_item_model.h" @@ -595,6 +596,9 @@ TabContents::TabContents(Profile* profile, AddNavigationObserver(prerender_plt_recorder_.get()); AddNavigationObserver(&fav_icon_helper_); AddNavigationObserver(printing_.get()); + desktop_notification_handler_.reset( + new DesktopNotificationHandler(this, GetRenderProcessHost())); + AddNavigationObserver(desktop_notification_handler_.get()); } TabContents::~TabContents() { -- cgit v1.1