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