Index: chrome/browser/notifications/balloon_contents_win.h |
diff --git a/chrome/browser/notifications/balloon_contents_win.h b/chrome/browser/notifications/balloon_contents_win.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ad9fc7773a7131430836669500586c9b0efa4f50 |
--- /dev/null |
+++ b/chrome/browser/notifications/balloon_contents_win.h |
@@ -0,0 +1,77 @@ |
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_NOTIFICATIONS_BALLOON_CONTENTS_H_ |
+#define CHROME_BROWSER_NOTIFICATIONS_BALLOON_CONTENTS_H_ |
+ |
+#include "chrome/browser/renderer_host/render_view_host_delegate.h" |
+#include "views/controls/native/native_view_host.h" |
+#include "webkit/glue/webpreferences.h" |
+ |
+class Balloon; |
+class Profile; |
+class SiteInstance; |
+class RenderViewHost; |
+ |
+class BalloonContents : public views::NativeViewHost, |
+ public RenderViewHostDelegate { |
+ public: |
+ explicit BalloonContents(Balloon* balloon); |
+ |
+ // Stops showing the balloon. |
+ void Shutdown(); |
+ |
+ // RenderViewHostDelegate implementations. |
+ virtual WebPreferences GetWebkitPrefs(); |
+ virtual RendererPreferences GetRendererPrefs() const; |
+ virtual SiteInstance* GetSiteInstance() const; |
+ virtual Profile* GetProfile() const; |
+ virtual const GURL& GetURL() const; |
+ virtual void RequestOpenURL(const GURL& url, |
+ const GURL& referrer, |
+ WindowOpenDisposition disposition); |
+ virtual void RendererReady(RenderViewHost* render_view_host); |
+ virtual void RendererGone(RenderViewHost* render_view_host); |
+ virtual void UpdateTitle(RenderViewHost* render_view_host, |
+ int32 page_id, |
+ const std::wstring& title); |
+ virtual int GetBrowserWindowID() const { return -1; } |
+ virtual ViewType::Type GetRenderViewType() const { return ViewType::TAB_CONTENTS; } |
+ |
+ // Accessors. |
+ RenderViewHost* render_view_host() const { return render_view_host_; } |
+ const std::wstring& title() const { return title_; } |
+ |
+ private: |
+ // View overrides. |
+ virtual void ViewHierarchyChanged(bool is_add, views::View *parent, views::View *child); |
+ |
+ // Initialize the view, parented to |parent|, and show it. |
+ void Init(HWND parent); |
+ |
+ // Helper functions for sending notifications. |
+ void NotifyConnected(); |
+ void NotifyDisconnected(); |
+ |
+ // True after Init() has completed. |
+ bool initialized_; |
+ |
+ // The associated balloon. |
+ Balloon* balloon_; |
+ |
+ // The host HTML renderer. |
+ RenderViewHost* render_view_host_; |
+ |
+ // Indicates whether we should notify about disconnection of this balloon. |
+ // This is used to ensure disconnection notifications only happen if |
+ // a connection notification has happened and that they happen only once. |
+ bool notify_disconnection_; |
+ |
+ // The title of the balloon page. |
+ std::wstring title_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BalloonContents); |
+}; |
+ |
+#endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_CONTENTS_H_ |