Home | History | Annotate | Download | only in notifications
      1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.h"
      6 
      7 #include "chrome/browser/notifications/balloon.h"
      8 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
      9 #include "content/browser/renderer_host/render_view_host.h"
     10 #include "content/browser/renderer_host/render_widget_host_view.h"
     11 
     12 BalloonViewHost::BalloonViewHost(Balloon* balloon)
     13     : BalloonHost(balloon),
     14       render_widget_host_view_(NULL) {
     15 }
     16 
     17 void BalloonViewHost::UpdateActualSize(const gfx::Size& new_size) {
     18   render_widget_host_view_->SetSize(new_size);
     19   gtk_widget_set_size_request(
     20       native_view(), new_size.width(), new_size.height());
     21 }
     22 
     23 gfx::NativeView BalloonViewHost::native_view() const {
     24   return render_widget_host_view_->native_view();
     25 }
     26 
     27 void BalloonViewHost::InitRenderWidgetHostView() {
     28   DCHECK(render_view_host_);
     29   render_widget_host_view_ = new RenderWidgetHostViewGtk(render_view_host_);
     30   render_widget_host_view_->InitAsChild();
     31 }
     32 
     33 RenderWidgetHostView* BalloonViewHost::render_widget_host_view() const {
     34   return render_widget_host_view_;
     35 }
     36