1 // Copyright (c) 2012 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.
5 #include "chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.h"
9 #include "chrome/browser/notifications/balloon.h"
10 #include "content/public/browser/render_view_host.h"
11 #include "content/public/browser/render_widget_host_view.h"
12 #include "content/public/browser/web_contents.h"
13 #include "content/public/browser/web_contents_view.h"
15 BalloonViewHost::BalloonViewHost(Balloon
* balloon
)
16 : BalloonHost(balloon
) {
19 BalloonViewHost::~BalloonViewHost() {
23 void BalloonViewHost::UpdateActualSize(const gfx::Size
& new_size
) {
24 content::RenderViewHost
* host
= web_contents_
->GetRenderViewHost();
26 content::RenderWidgetHostView
* view
= host
->GetView();
28 view
->SetSize(new_size
);
31 gtk_widget_set_size_request(
32 native_view(), new_size
.width(), new_size
.height());
35 gfx::NativeView
BalloonViewHost::native_view() const {
36 return web_contents_
->GetView()->GetNativeView();