diff options
9 files changed, 47 insertions, 31 deletions
diff --git a/chrome/browser/cocoa/notifications/balloon_controller.h b/chrome/browser/cocoa/notifications/balloon_controller.h index 8199265..b0502c0 100644 --- a/chrome/browser/cocoa/notifications/balloon_controller.h +++ b/chrome/browser/cocoa/notifications/balloon_controller.h @@ -8,13 +8,15 @@ #import <Cocoa/Cocoa.h> -#include "base/scoped_nsobject.h" #include "base/cocoa_protocols_mac.h" -#import "chrome/browser/cocoa/hover_image_button.h" -#import "chrome/browser/cocoa/notifications/balloon_view.h" -#import "chrome/browser/cocoa/notifications/balloon_view_host_mac.h" -#include "chrome/browser/notifications/balloon.h" +#include "base/scoped_nsobject.h" +#include "base/scoped_ptr.h" +class Balloon; +@class BalloonContentViewCocoa; +@class BalloonShelfViewCocoa; +class BalloonViewHost; +@class HoverImageButton; @class MenuController; class NotificationOptionsMenuModel; diff --git a/chrome/browser/cocoa/notifications/balloon_controller.mm b/chrome/browser/cocoa/notifications/balloon_controller.mm index 55ee041..745c091 100644 --- a/chrome/browser/cocoa/notifications/balloon_controller.mm +++ b/chrome/browser/cocoa/notifications/balloon_controller.mm @@ -11,7 +11,9 @@ #include "base/nsimage_cache_mac.h" #import "base/scoped_nsobject.h" #include "base/utf_string_conversions.h" +#import "chrome/browser/cocoa/hover_image_button.h" #import "chrome/browser/cocoa/menu_controller.h" +#import "chrome/browser/cocoa/notifications/balloon_view.h" #include "chrome/browser/cocoa/notifications/balloon_view_host_mac.h" #include "chrome/browser/notifications/balloon.h" #include "chrome/browser/notifications/desktop_notification_service.h" diff --git a/chrome/browser/cocoa/notifications/balloon_view.h b/chrome/browser/cocoa/notifications/balloon_view.h index 5164360..819df68 100644 --- a/chrome/browser/cocoa/notifications/balloon_view.h +++ b/chrome/browser/cocoa/notifications/balloon_view.h @@ -8,8 +8,6 @@ #import <Cocoa/Cocoa.h> -#include "base/scoped_nsobject.h" - @interface BalloonWindow : NSWindow { } @end diff --git a/chrome/browser/cocoa/notifications/balloon_view_bridge.h b/chrome/browser/cocoa/notifications/balloon_view_bridge.h index 01adcd8..985fcde 100644 --- a/chrome/browser/cocoa/notifications/balloon_view_bridge.h +++ b/chrome/browser/cocoa/notifications/balloon_view_bridge.h @@ -6,10 +6,13 @@ #define CHROME_BROWSER_COCOA_NOTIFICATIONS_BALLOON_VIEW_BRIDGE_H_ #pragma once -#include "base/scoped_nsobject.h" -#import "chrome/browser/cocoa/notifications/balloon_controller.h" #include "chrome/browser/notifications/balloon.h" -#include "gfx/size.h" + +@class BalloonController; +class BalloonHost; +namespace gfx { +class Size; +} // Bridges from the cross-platform BalloonView interface to the Cocoa // controller which will draw the view on screen. diff --git a/chrome/browser/cocoa/notifications/balloon_view_bridge.mm b/chrome/browser/cocoa/notifications/balloon_view_bridge.mm index 7f6aa7c..c0b8b1f 100644 --- a/chrome/browser/cocoa/notifications/balloon_view_bridge.mm +++ b/chrome/browser/cocoa/notifications/balloon_view_bridge.mm @@ -4,6 +4,10 @@ #include "chrome/browser/cocoa/notifications/balloon_view_bridge.h" +#include "chrome/browser/cocoa/notifications/balloon_controller.h" +#import "chrome/browser/cocoa/notifications/balloon_view_host_mac.h" +#include "gfx/size.h" + #import <Cocoa/Cocoa.h> BalloonViewBridge::BalloonViewBridge() : diff --git a/chrome/browser/cocoa/notifications/balloon_view_host_mac.h b/chrome/browser/cocoa/notifications/balloon_view_host_mac.h index 286d5b1..3ef85b2 100644 --- a/chrome/browser/cocoa/notifications/balloon_view_host_mac.h +++ b/chrome/browser/cocoa/notifications/balloon_view_host_mac.h @@ -7,7 +7,9 @@ #pragma once #include "chrome/browser/notifications/balloon_host.h" -#import "chrome/browser/renderer_host/render_widget_host_view_mac.h" + +class RenderWidgetHostView; +class RenderWidgetHostViewMac; // BalloonViewHost class is a delegate to the renderer host for the HTML // notification. When initialized it creates a new RenderViewHost and loads @@ -17,23 +19,17 @@ class BalloonViewHost : public BalloonHost { public: explicit BalloonViewHost(Balloon* balloon); - ~BalloonViewHost() { - Shutdown(); - } + ~BalloonViewHost(); // Changes the size of the balloon. void UpdateActualSize(const gfx::Size& new_size); // Accessors. - gfx::NativeView native_view() const { - return render_widget_host_view_->native_view(); - } + gfx::NativeView native_view() const; protected: virtual void InitRenderWidgetHostView(); - virtual RenderWidgetHostView* render_widget_host_view() const { - return render_widget_host_view_; - } + virtual RenderWidgetHostView* render_widget_host_view() const; private: // The Mac-specific widget host view. This is owned by its native view, diff --git a/chrome/browser/cocoa/notifications/balloon_view_host_mac.mm b/chrome/browser/cocoa/notifications/balloon_view_host_mac.mm index 3b3aa35..67b75b3 100644 --- a/chrome/browser/cocoa/notifications/balloon_view_host_mac.mm +++ b/chrome/browser/cocoa/notifications/balloon_view_host_mac.mm @@ -4,15 +4,17 @@ #include "chrome/browser/cocoa/notifications/balloon_view_host_mac.h" -#include "chrome/browser/notifications/balloon.h" #include "chrome/browser/renderer_host/render_view_host.h" -#include "chrome/browser/renderer_host/render_widget_host_view.h" #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" BalloonViewHost::BalloonViewHost(Balloon* balloon) : BalloonHost(balloon) { } +BalloonViewHost::~BalloonViewHost() { + Shutdown(); +} + void BalloonViewHost::UpdateActualSize(const gfx::Size& new_size) { NSView* view = render_widget_host_view_->native_view(); NSRect frame = [view frame]; @@ -23,8 +25,15 @@ void BalloonViewHost::UpdateActualSize(const gfx::Size& new_size) { [view setNeedsDisplay:YES]; } +gfx::NativeView BalloonViewHost::native_view() const { + return render_widget_host_view_->native_view(); +} + void BalloonViewHost::InitRenderWidgetHostView() { DCHECK(render_view_host_); render_widget_host_view_ = new RenderWidgetHostViewMac(render_view_host_); } +RenderWidgetHostView* BalloonViewHost::render_widget_host_view() const { + return render_widget_host_view_; +} diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index ecb52cd..04f0b89 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -7,6 +7,7 @@ #include "chrome/browser/browser_list.h" #include "chrome/browser/extensions/extension_process_manager.h" #include "chrome/browser/notifications/balloon.h" +#include "chrome/browser/notifications/notification.h" #include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/site_instance.h" @@ -17,6 +18,7 @@ #include "chrome/common/render_messages.h" #include "chrome/common/renderer_preferences.h" #include "chrome/common/url_constants.h" +#include "webkit/glue/webpreferences.h" BalloonHost::BalloonHost(Balloon* balloon) : render_view_host_(NULL), @@ -59,6 +61,10 @@ gfx::NativeView BalloonHost::GetNativeViewOfHost() { TabContents* BalloonHost::associated_tab_contents() const { return NULL; } +const string16& BalloonHost::GetSource() const { + return balloon_->notification().display_source(); +} + WebPreferences BalloonHost::GetWebkitPrefs() { WebPreferences prefs; prefs.allow_scripts_to_close_windows = true; diff --git a/chrome/browser/notifications/balloon_host.h b/chrome/browser/notifications/balloon_host.h index 09d54ea..4e51eba 100644 --- a/chrome/browser/notifications/balloon_host.h +++ b/chrome/browser/notifications/balloon_host.h @@ -10,17 +10,15 @@ #include <vector> #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" -#include "chrome/browser/renderer_host/site_instance.h" #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" -#include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/renderer_preferences.h" -#include "webkit/glue/webpreferences.h" +class Balloon; class Browser; class Profile; +class SiteInstance; +struct RendererPreferences; +struct WebPreferences; class BalloonHost : public RenderViewHostDelegate, public RenderViewHostDelegate::View, @@ -41,9 +39,7 @@ class BalloonHost : public RenderViewHostDelegate, RenderViewHost* render_view_host() const { return render_view_host_; } - const string16& GetSource() const { - return balloon_->notification().display_source(); - } + const string16& GetSource() const; // RenderViewHostDelegate overrides. virtual WebPreferences GetWebkitPrefs(); |