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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_NOTIFICATIONS_BALLOON_VIEW_HOST_H_
6 #define CHROME_BROWSER_UI_VIEWS_NOTIFICATIONS_BALLOON_VIEW_HOST_H_
8 #include "chrome/browser/notifications/balloon_host.h"
9 #include "ui/views/controls/native/native_view_host.h"
11 // BalloonViewHost class is a delegate to the renderer host for the HTML
12 // notification. When initialized it creates a new RenderViewHost and loads
13 // the contents of the toast into it. It also handles links within the toast,
14 // loading them into a new tab.
15 class BalloonViewHost
: public BalloonHost
{
17 explicit BalloonViewHost(Balloon
* balloon
);
19 virtual ~BalloonViewHost();
21 void SetPreferredSize(const gfx::Size
& size
) {
22 native_host_
->SetPreferredSize(size
);
30 gfx::NativeView
native_view() const {
31 return native_host_
->native_view();
34 // Initialize the view, parented to |parent|, and show it.
35 void Init(gfx::NativeView parent
);
38 // The views-specific host view. Pointer owned by the views hierarchy.
39 views::NativeViewHost
* native_host_
;
41 // The handle to the parent view.
42 gfx::NativeView parent_native_view_
;
44 DISALLOW_COPY_AND_ASSIGN(BalloonViewHost
);
47 #endif // CHROME_BROWSER_UI_VIEWS_NOTIFICATIONS_BALLOON_VIEW_HOST_H_