| 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/public/browser/render_view_host.h" | 10 #include "content/public/browser/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 #include "content/public/browser/web_contents_view.h" |
| 13 | 14 |
| 14 BalloonViewHost::BalloonViewHost(Balloon* balloon) | 15 BalloonViewHost::BalloonViewHost(Balloon* balloon) |
| 15 : BalloonHost(balloon) { | 16 : BalloonHost(balloon) { |
| 16 } | 17 } |
| 17 | 18 |
| 18 BalloonViewHost::~BalloonViewHost() { | 19 BalloonViewHost::~BalloonViewHost() { |
| 19 Shutdown(); | 20 Shutdown(); |
| 20 } | 21 } |
| 21 | 22 |
| 22 void BalloonViewHost::UpdateActualSize(const gfx::Size& new_size) { | 23 void BalloonViewHost::UpdateActualSize(const gfx::Size& new_size) { |
| 23 content::RenderViewHost* host = web_contents_->GetRenderViewHost(); | 24 content::RenderViewHost* host = web_contents_->GetRenderViewHost(); |
| 24 if (host) { | 25 if (host) { |
| 25 content::RenderWidgetHostView* view = host->GetView(); | 26 content::RenderWidgetHostView* view = host->GetView(); |
| 26 if (view) | 27 if (view) |
| 27 view->SetSize(new_size); | 28 view->SetSize(new_size); |
| 28 } | 29 } |
| 29 | 30 |
| 30 gtk_widget_set_size_request( | 31 gtk_widget_set_size_request( |
| 31 native_view(), new_size.width(), new_size.height()); | 32 native_view(), new_size.width(), new_size.height()); |
| 32 } | 33 } |
| 33 | 34 |
| 34 gfx::NativeView BalloonViewHost::native_view() const { | 35 gfx::NativeView BalloonViewHost::native_view() const { |
| 35 return web_contents_->GetNativeView(); | 36 return web_contents_->GetView()->GetNativeView(); |
| 36 } | 37 } |
| OLD | NEW |