OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "chrome/browser/notifications/balloon.h" | 9 #include "chrome/browser/notifications/balloon.h" |
10 #include "content/browser/renderer_host/render_view_host.h" | 10 #include "content/browser/renderer_host/render_view_host.h" |
11 #include "content/public/browser/render_widget_host_view.h" | 11 #include "content/public/browser/render_widget_host_view.h" |
12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
13 | 13 |
14 BalloonViewHost::BalloonViewHost(Balloon* balloon) | 14 BalloonViewHost::BalloonViewHost(Balloon* balloon) |
15 : BalloonHost(balloon) { | 15 : BalloonHost(balloon) { |
16 } | 16 } |
17 | 17 |
18 BalloonViewHost::~BalloonViewHost() { | 18 BalloonViewHost::~BalloonViewHost() { |
19 Shutdown(); | 19 Shutdown(); |
20 } | 20 } |
21 | 21 |
22 void BalloonViewHost::UpdateActualSize(const gfx::Size& new_size) { | 22 void BalloonViewHost::UpdateActualSize(const gfx::Size& new_size) { |
23 RenderViewHost* host = web_contents_->GetRenderViewHost(); | 23 RenderViewHost* host = web_contents_->GetRenderViewHost(); |
24 if (host) { | 24 if (host) { |
25 content::RenderWidgetHostView* view = host->view(); | 25 content::RenderWidgetHostView* view = host->GetView(); |
26 if (view) | 26 if (view) |
27 view->SetSize(new_size); | 27 view->SetSize(new_size); |
28 } | 28 } |
29 | 29 |
30 gtk_widget_set_size_request( | 30 gtk_widget_set_size_request( |
31 native_view(), new_size.width(), new_size.height()); | 31 native_view(), new_size.width(), new_size.height()); |
32 } | 32 } |
33 | 33 |
34 gfx::NativeView BalloonViewHost::native_view() const { | 34 gfx::NativeView BalloonViewHost::native_view() const { |
35 return web_contents_->GetNativeView(); | 35 return web_contents_->GetNativeView(); |
36 } | 36 } |
OLD | NEW |