1 // Copyright (c) 2010 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/cocoa/notifications/balloon_view_host_mac.h" 6 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" 8 #include "content/browser/renderer_host/render_view_host.h" 9 10 BalloonViewHost::BalloonViewHost(Balloon* balloon) 11 : BalloonHost(balloon) { 12 } 13 14 BalloonViewHost::~BalloonViewHost() { 15 Shutdown(); 16 } 17 18 void BalloonViewHost::UpdateActualSize(const gfx::Size& new_size) { 19 NSView* view = render_widget_host_view_->native_view(); 20 NSRect frame = [view frame]; 21 frame.size.width = new_size.width(); 22 frame.size.height = new_size.height(); 23 24 [view setFrame:frame]; 25 [view setNeedsDisplay:YES]; 26 } 27 28 gfx::NativeView BalloonViewHost::native_view() const { 29 return render_widget_host_view_->native_view(); 30 } 31 32 void BalloonViewHost::InitRenderWidgetHostView() { 33 DCHECK(render_view_host_); 34 render_widget_host_view_ = new RenderWidgetHostViewMac(render_view_host_); 35 } 36 37 RenderWidgetHostView* BalloonViewHost::render_widget_host_view() const { 38 return render_widget_host_view_; 39 } 40