diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 18:23:41 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 18:23:41 +0000 |
commit | c87b2881458763fb9d82066bbfd2fe696431e2db (patch) | |
tree | f5a4acbbddf3632a6c1117ad8baea5088603e1be /chrome/browser/notifications | |
parent | 827ccbbcbbbbf0e26c12877268e00e53d505c8e4 (diff) | |
download | chromium_src-c87b2881458763fb9d82066bbfd2fe696431e2db.zip chromium_src-c87b2881458763fb9d82066bbfd2fe696431e2db.tar.gz chromium_src-c87b2881458763fb9d82066bbfd2fe696431e2db.tar.bz2 |
Revert 42631 as it seems to have broken browser tests on linux_views.
TBR=rafaelw@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42644 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications')
-rw-r--r-- | chrome/browser/notifications/balloon_host.cc | 25 | ||||
-rw-r--r-- | chrome/browser/notifications/balloon_host.h | 26 |
2 files changed, 11 insertions, 40 deletions
diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index 9e9ba28..3b4a832 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -23,7 +23,8 @@ BalloonHost::BalloonHost(Balloon* balloon) : render_view_host_(NULL), balloon_(balloon), initialized_(false), - should_notify_on_disconnect_(false) { + should_notify_on_disconnect_(false), + is_extension_page_(false) { DCHECK(balloon_); // If the notification is for an extension URL, make sure to use the extension @@ -31,6 +32,7 @@ BalloonHost::BalloonHost(Balloon* balloon) // extension. const GURL& balloon_url = balloon_->notification().content_url(); if (balloon_url.SchemeIs(chrome::kExtensionScheme)) { + is_extension_page_ = true; site_instance_ = balloon_->profile()->GetExtensionProcessManager()->GetSiteInstanceForURL( balloon_url); @@ -79,16 +81,6 @@ void BalloonHost::RendererGone(RenderViewHost* render_view_host) { Source<Balloon>(balloon_), NotificationService::NoDetails()); } -void BalloonHost::ProcessDOMUIMessage(const std::string& message, - const Value* content, - int request_id, - bool has_callback) { - if (extension_function_dispatcher_.get()) { - extension_function_dispatcher_->HandleRequest( - message, content, request_id, has_callback); - } -} - // RenderViewHostDelegate::View methods implemented to allow links to // open pages in new tabs. void BalloonHost::CreateNewWindow(int route_id) { @@ -98,9 +90,9 @@ void BalloonHost::CreateNewWindow(int route_id) { } void BalloonHost::ShowCreatedWindow(int route_id, - WindowOpenDisposition disposition, - const gfx::Rect& initial_pos, - bool user_gesture) { + WindowOpenDisposition disposition, + const gfx::Rect& initial_pos, + bool user_gesture) { // Don't allow pop-ups from notifications. if (disposition == NEW_POPUP) return; @@ -123,10 +115,7 @@ void BalloonHost::Init() { RenderViewHost* rvh = new RenderViewHost(site_instance_.get(), this, MSG_ROUTING_NONE, session_storage_namespace_id); - extension_function_dispatcher_.reset( - ExtensionFunctionDispatcher::Create( - rvh, this, balloon_->notification().content_url())); - if (extension_function_dispatcher_.get()) + if (is_extension_page_) rvh->AllowBindings(BindingsPolicy::EXTENSION); // Do platform-specific initialization. diff --git a/chrome/browser/notifications/balloon_host.h b/chrome/browser/notifications/balloon_host.h index b1f47a2..b42ea46 100644 --- a/chrome/browser/notifications/balloon_host.h +++ b/chrome/browser/notifications/balloon_host.h @@ -5,7 +5,6 @@ #ifndef CHROME_BROWSER_NOTIFICATIONS_BALLOON_HOST_H_ #define CHROME_BROWSER_NOTIFICATIONS_BALLOON_HOST_H_ -#include "chrome/browser/extensions/extension_function_dispatcher.h" #include "chrome/browser/notifications/balloon.h" #include "chrome/browser/notifications/notification.h" #include "chrome/browser/renderer_host/render_view_host_delegate.h" @@ -14,12 +13,10 @@ #include "chrome/common/renderer_preferences.h" #include "webkit/glue/webpreferences.h" -class Browser; class Profile; class BalloonHost : public RenderViewHostDelegate, - public RenderViewHostDelegate::View, - public ExtensionFunctionDispatcher::Delegate { + public RenderViewHostDelegate::View { public: explicit BalloonHost(Balloon* balloon); @@ -29,16 +26,6 @@ class BalloonHost : public RenderViewHostDelegate, // Stops showing the balloon. void Shutdown(); - // ExtensionFunctionDispatcher::Delegate overrides. - virtual Browser* GetBrowser() const { - // Notifications aren't associated with a particular browser. - return NULL; - } - virtual gfx::NativeView GetNativeViewOfHost() { - // TODO(aa): Should this return the native view of the BalloonView*? - return NULL; - } - RenderViewHost* render_view_host() const { return render_view_host_; } // RenderViewHostDelegate overrides. @@ -63,10 +50,6 @@ class BalloonHost : public RenderViewHostDelegate, virtual RenderViewHostDelegate::View* GetViewDelegate() { return this; } - virtual void ProcessDOMUIMessage(const std::string& message, - const Value* content, - int request_id, - bool has_callback); // RenderViewHostDelegate::View methods. Only the ones for opening new // windows are currently implemented. @@ -120,15 +103,14 @@ class BalloonHost : public RenderViewHostDelegate, // a connection notification has happened and that they happen only once. bool should_notify_on_disconnect_; + // Whether the page we are rendering is from an extension. + bool is_extension_page_; + // Site instance for the balloon/profile, to be used for opening new links. scoped_refptr<SiteInstance> site_instance_; // Common implementations of some RenderViewHostDelegate::View methods. RenderViewHostDelegateViewHelper delegate_view_helper_; - - // Handles requests to extension APIs. Will only be non-NULL if we are - // rendering a page from an extension. - scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; }; #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_HOST_H_ |