| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_NOTIFICATIONS_BALLOON_VIEW_HOST_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_NOTIFICATIONS_BALLOON_VIEW_HOST_H_ | |
| 7 | |
| 8 #include "chrome/browser/notifications/balloon_host.h" | |
| 9 #include "ui/views/controls/native/native_view_host.h" | |
| 10 | |
| 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 { | |
| 16 public: | |
| 17 explicit BalloonViewHost(Balloon* balloon); | |
| 18 | |
| 19 virtual ~BalloonViewHost(); | |
| 20 | |
| 21 void SetPreferredSize(const gfx::Size& size) { | |
| 22 native_host_->SetPreferredSize(size); | |
| 23 } | |
| 24 | |
| 25 // Accessors. | |
| 26 views::View* view() { | |
| 27 return native_host_; | |
| 28 } | |
| 29 | |
| 30 gfx::NativeView native_view() const { | |
| 31 return native_host_->native_view(); | |
| 32 } | |
| 33 | |
| 34 // Initialize the view, parented to |parent|, and show it. | |
| 35 void Init(gfx::NativeView parent); | |
| 36 | |
| 37 private: | |
| 38 // The views-specific host view. Pointer owned by the views hierarchy. | |
| 39 views::NativeViewHost* native_host_; | |
| 40 | |
| 41 // The handle to the parent view. | |
| 42 gfx::NativeView parent_native_view_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(BalloonViewHost); | |
| 45 }; | |
| 46 | |
| 47 #endif // CHROME_BROWSER_UI_VIEWS_NOTIFICATIONS_BALLOON_VIEW_HOST_H_ | |
| OLD | NEW |