summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/tab_contents_container_gtk.h
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-19 22:01:26 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-19 22:01:26 +0000
commitfa5c9a0393065b41c2b81fc20e12ff232cafb17b (patch)
treee23686f952a7e2e16c5954f05b5028ffde30970b /chrome/browser/gtk/tab_contents_container_gtk.h
parent12b5d06ea959032da7288b8b2b435adfc2c2cea3 (diff)
downloadchromium_src-fa5c9a0393065b41c2b81fc20e12ff232cafb17b.zip
chromium_src-fa5c9a0393065b41c2b81fc20e12ff232cafb17b.tar.gz
chromium_src-fa5c9a0393065b41c2b81fc20e12ff232cafb17b.tar.bz2
Add a TabContentsContainerGtk to remove the current hack that inserts the
RenderViewHostGtk native_view() into the widget heiarchy. (Now we're crashing on cross site instance navigation because it looks like we aren't updating some internal reference to the new renderer.) Review URL: http://codereview.chromium.org/21517 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/tab_contents_container_gtk.h')
-rw-r--r--chrome/browser/gtk/tab_contents_container_gtk.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/chrome/browser/gtk/tab_contents_container_gtk.h b/chrome/browser/gtk/tab_contents_container_gtk.h
new file mode 100644
index 0000000..927f1f6
--- /dev/null
+++ b/chrome/browser/gtk/tab_contents_container_gtk.h
@@ -0,0 +1,59 @@
+// 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_GTK_TAB_CONTENTS_CONTAINER_GTK_H__
+#define CHROME_BROWSER_GTK_TAB_CONTENTS_CONTAINER_GTK_H__
+
+#include <gtk/gtk.h>
+
+#include "base/basictypes.h"
+#include "chrome/common/notification_observer.h"
+
+class RenderViewHost;
+class TabContents;
+
+class TabContentsContainerGtk : public NotificationObserver {
+ public:
+ TabContentsContainerGtk();
+ ~TabContentsContainerGtk();
+
+ // Inserts our GtkWidget* hierarchy into a GtkBox managed by our owner.
+ void AddContainerToBox(GtkWidget* widget);
+
+ // Make the specified tab visible.
+ void SetTabContents(TabContents* tab_contents);
+ TabContents* GetTabContents() const { return tab_contents_; }
+
+ // NotificationObserver implementation.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ private:
+ // Add or remove observers for events that we care about.
+ void AddObservers();
+ void RemoveObservers();
+
+ // Called when the RenderViewHost of the hosted TabContents has changed, e.g.
+ // to show an interstitial page.
+ void RenderViewHostChanged(RenderViewHost* old_host,
+ RenderViewHost* new_host);
+
+ // Called when a TabContents is destroyed. This gives us a chance to clean
+ // up our internal state if the TabContents is somehow destroyed before we
+ // get notified.
+ void TabContentsDestroyed(TabContents* contents);
+
+ // The currently visible TabContents.
+ TabContents* tab_contents_;
+
+ // We keep a GtkVBox which is inserted into this object's owner's GtkWidget
+ // hierarchy. We then insert and remove WebContents GtkWidgets into this
+ // vbox_.
+ GtkWidget* vbox_;
+
+ DISALLOW_EVIL_CONSTRUCTORS(TabContentsContainerGtk);
+};
+
+#endif // CHROME_BROWSER_GTK_TAB_CONTENTS_CONTAINER_GTK_H__