diff options
Diffstat (limited to 'chrome/browser/ui/views/notifications')
4 files changed, 20 insertions, 14 deletions
diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc index d2696d4..034e0a0 100644 --- a/chrome/browser/ui/views/notifications/balloon_view.cc +++ b/chrome/browser/ui/views/notifications/balloon_view.cc @@ -16,7 +16,6 @@ #include "chrome/browser/notifications/desktop_notification_service.h" #include "chrome/browser/notifications/notification.h" #include "chrome/browser/notifications/notification_options_menu_model.h" -#include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/render_widget_host_view.h" #include "chrome/browser/themes/browser_theme_provider.h" @@ -132,6 +131,10 @@ gfx::Size BalloonViewImpl::GetSize() const { return gfx::Size(GetTotalWidth(), GetTotalHeight()); } +BalloonHost* BalloonViewImpl::GetHost() const { + return html_contents_.get(); +} + void BalloonViewImpl::RunMenu(views::View* source, const gfx::Point& pt) { RunOptionsMenu(pt); } @@ -167,6 +170,10 @@ void BalloonViewImpl::DidChangeBounds(const gfx::Rect& previous, SizeContentsWindow(); } +gfx::Size BalloonViewImpl::GetPreferredSize() { + return gfx::Size(1000, 1000); +} + void BalloonViewImpl::SizeContentsWindow() { if (!html_container_ || !frame_container_) return; diff --git a/chrome/browser/ui/views/notifications/balloon_view.h b/chrome/browser/ui/views/notifications/balloon_view.h index 7372c84..c069a0a 100644 --- a/chrome/browser/ui/views/notifications/balloon_view.h +++ b/chrome/browser/ui/views/notifications/balloon_view.h @@ -15,7 +15,6 @@ #include "chrome/browser/notifications/balloon.h" #include "chrome/browser/views/notifications/balloon_view_host.h" #include "chrome/common/notification_registrar.h" -#include "chrome/common/notification_service.h" #include "gfx/path.h" #include "gfx/point.h" #include "gfx/rect.h" @@ -60,23 +59,21 @@ class BalloonViewImpl : public BalloonView, virtual void RepositionToBalloon(); virtual void Close(bool by_user); virtual gfx::Size GetSize() const; - virtual BalloonHost* GetHost() const { return html_contents_.get(); } + virtual BalloonHost* GetHost() const; private: // views::View interface. virtual void Paint(gfx::Canvas* canvas); virtual void DidChangeBounds(const gfx::Rect& previous, const gfx::Rect& current); - virtual gfx::Size GetPreferredSize() { - return gfx::Size(1000, 1000); - } + virtual gfx::Size GetPreferredSize(); // views::ViewMenuDelegate interface. - void RunMenu(views::View* source, const gfx::Point& pt); + virtual void RunMenu(views::View* source, const gfx::Point& pt); // views::WidgetDelegate interface. - void DisplayChanged(); - void WorkAreaChanged(); + virtual void DisplayChanged(); + virtual void WorkAreaChanged(); // views::ButtonListener interface. virtual void ButtonPressed(views::Button* sender, const views::Event&); diff --git a/chrome/browser/ui/views/notifications/balloon_view_host.cc b/chrome/browser/ui/views/notifications/balloon_view_host.cc index 24a7fe2..eb9cb20 100644 --- a/chrome/browser/ui/views/notifications/balloon_view_host.cc +++ b/chrome/browser/ui/views/notifications/balloon_view_host.cc @@ -37,8 +37,8 @@ class BalloonViewHostView : public views::NativeViewHost { views::View* child) { NativeViewHost::ViewHierarchyChanged(is_add, parent, child); if (is_add && GetWidget() && !initialized_) { - host_->Init(GetWidget()->GetNativeView()); initialized_ = true; + host_->Init(GetWidget()->GetNativeView()); } } @@ -79,7 +79,7 @@ void BalloonViewHost::InitRenderWidgetHostView() { RenderWidgetHostViewViews* view_views = static_cast<RenderWidgetHostViewViews*>(render_widget_host_view_); view_views->InitAsChild(); - native_host_->Attach(view_views->native_view()); + native_host_->AttachToView(view_views); #else RenderWidgetHostViewGtk* view_gtk = static_cast<RenderWidgetHostViewGtk*>(render_widget_host_view_); @@ -90,3 +90,7 @@ void BalloonViewHost::InitRenderWidgetHostView() { NOTIMPLEMENTED(); #endif } + +RenderWidgetHostView* BalloonViewHost::render_widget_host_view() const { + return render_widget_host_view_; +} diff --git a/chrome/browser/ui/views/notifications/balloon_view_host.h b/chrome/browser/ui/views/notifications/balloon_view_host.h index a2f6663..23f82b9 100644 --- a/chrome/browser/ui/views/notifications/balloon_view_host.h +++ b/chrome/browser/ui/views/notifications/balloon_view_host.h @@ -39,9 +39,7 @@ class BalloonViewHost : public BalloonHost { 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 platform-specific widget host view. Pointer is owned by the RVH. |