summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc8
-rw-r--r--chrome/browser/gtk/find_bar_gtk.cc14
-rw-r--r--chrome/browser/gtk/find_bar_gtk.h1
-rw-r--r--chrome/browser/gtk/tab_contents_container_gtk.cc32
-rw-r--r--chrome/browser/gtk/tab_contents_container_gtk.h2
5 files changed, 27 insertions, 30 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index e240182..3c2e285 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -30,7 +30,7 @@
#include "chrome/browser/gtk/toolbar_star_toggle_gtk.h"
#include "chrome/browser/location_bar.h"
#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_service.h"
@@ -574,10 +574,8 @@ void BrowserWindowGtk::TabSelectedAt(TabContents* old_contents,
new_contents->DidBecomeSelected();
// TODO(estade): after we manage browser activation, add a check to make sure
// we are the active browser before calling RestoreFocus().
- if (!browser_->tabstrip_model()->closing_all() &&
- new_contents->AsWebContents()) {
- new_contents->AsWebContents()->view()->RestoreFocus();
- }
+ if (!browser_->tabstrip_model()->closing_all())
+ new_contents->view()->RestoreFocus();
// Update all the UI bits.
UpdateTitleBar();
diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc
index b37d8e7..cbdd54c 100644
--- a/chrome/browser/gtk/find_bar_gtk.cc
+++ b/chrome/browser/gtk/find_bar_gtk.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/gtk/nine_box.h"
#include "chrome/browser/gtk/slide_animator_gtk.h"
#include "chrome/browser/gtk/tab_contents_container_gtk.h"
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/gtk_util.h"
#include "chrome/common/l10n_util.h"
#include "grit/generated_resources.h"
@@ -117,7 +117,7 @@ void FindBarGtk::InitWidgets() {
0, false, NULL));
// |fixed_| has to be at least one pixel tall. We color this pixel the same
- // color as the border that separates the toolbar from the web contents.
+ // color as the border that separates the toolbar from the tab contents.
fixed_.Own(gtk_fixed_new());
border_ = gtk_event_box_new();
gtk_widget_set_size_request(border_, 1, 1);
@@ -249,17 +249,17 @@ void FindBarGtk::AssureOnTop() {
}
void FindBarGtk::ContentsChanged() {
- WebContents* web_contents = find_bar_controller_->web_contents();
- if (!web_contents)
+ TabContents* tab_contents = find_bar_controller_->tab_contents();
+ if (!tab_contents)
return;
std::string new_contents(gtk_entry_get_text(GTK_ENTRY(find_text_)));
if (new_contents.length() > 0) {
- web_contents->StartFinding(UTF8ToUTF16(new_contents), true);
+ tab_contents->StartFinding(UTF8ToUTF16(new_contents), true);
} else {
// The textbox is empty so we reset.
- web_contents->StopFinding(true); // true = clear selection on page.
+ tab_contents->StopFinding(true); // true = clear selection on page.
}
}
@@ -275,7 +275,7 @@ void FindBarGtk::OnButtonPressed(GtkWidget* button, FindBarGtk* find_bar) {
button == find_bar->find_next_button_->widget()) {
std::string find_text_utf8(
gtk_entry_get_text(GTK_ENTRY(find_bar->find_text_)));
- find_bar->find_bar_controller_->web_contents()->StartFinding(
+ find_bar->find_bar_controller_->tab_contents()->StartFinding(
UTF8ToUTF16(find_text_utf8),
button == find_bar->find_next_button_->widget());
} else {
diff --git a/chrome/browser/gtk/find_bar_gtk.h b/chrome/browser/gtk/find_bar_gtk.h
index 90b0338..d1ec9ce 100644
--- a/chrome/browser/gtk/find_bar_gtk.h
+++ b/chrome/browser/gtk/find_bar_gtk.h
@@ -17,7 +17,6 @@ class CustomDrawButton;
class FindBarController;
class SlideAnimatorGtk;
class TabContentsContainerGtk;
-class WebContents;
// Currently this class contains both a model and a view. We may want to
// eventually pull out the model specific bits and share with Windows.
diff --git a/chrome/browser/gtk/tab_contents_container_gtk.cc b/chrome/browser/gtk/tab_contents_container_gtk.cc
index c4563bb..4c2ea19 100644
--- a/chrome/browser/gtk/tab_contents_container_gtk.cc
+++ b/chrome/browser/gtk/tab_contents_container_gtk.cc
@@ -6,7 +6,7 @@
#include "base/gfx/native_widget_types.h"
#include "chrome/browser/gtk/find_bar_gtk.h"
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#include "chrome/common/notification_service.h"
@@ -72,15 +72,15 @@ void TabContentsContainerGtk::Observe(NotificationType type,
void TabContentsContainerGtk::AddObservers() {
DCHECK(tab_contents_);
- if (tab_contents_->AsWebContents()) {
- // WebContents can change their RenderViewHost and hence the GtkWidget that
- // is shown. I'm not entirely sure that we need to observe this event under
- // GTK, but am putting a stub implementation and a comment saying that if
- // we crash after that NOTIMPLEMENTED(), we'll need it.
- NotificationService::current()->AddObserver(
- this, NotificationType::RENDER_VIEW_HOST_CHANGED,
- Source<NavigationController>(&tab_contents_->controller()));
- }
+
+ // TabContents can change their RenderViewHost and hence the GtkWidget that
+ // is shown. I'm not entirely sure that we need to observe this event under
+ // GTK, but am putting a stub implementation and a comment saying that if
+ // we crash after that NOTIMPLEMENTED(), we'll need it.
+ NotificationService::current()->AddObserver(
+ this, NotificationType::RENDER_VIEW_HOST_CHANGED,
+ Source<NavigationController>(&tab_contents_->controller()));
+
NotificationService::current()->AddObserver(
this,
NotificationType::TAB_CONTENTS_DESTROYED,
@@ -89,12 +89,12 @@ void TabContentsContainerGtk::AddObservers() {
void TabContentsContainerGtk::RemoveObservers() {
DCHECK(tab_contents_);
- if (tab_contents_->AsWebContents()) {
- NotificationService::current()->RemoveObserver(
- this,
- NotificationType::RENDER_VIEW_HOST_CHANGED,
- Source<NavigationController>(&tab_contents_->controller()));
- }
+
+ NotificationService::current()->RemoveObserver(
+ this,
+ NotificationType::RENDER_VIEW_HOST_CHANGED,
+ Source<NavigationController>(&tab_contents_->controller()));
+
NotificationService::current()->RemoveObserver(
this,
NotificationType::TAB_CONTENTS_DESTROYED,
diff --git a/chrome/browser/gtk/tab_contents_container_gtk.h b/chrome/browser/gtk/tab_contents_container_gtk.h
index d57adae..5ddad17 100644
--- a/chrome/browser/gtk/tab_contents_container_gtk.h
+++ b/chrome/browser/gtk/tab_contents_container_gtk.h
@@ -52,7 +52,7 @@ class TabContentsContainerGtk : public NotificationObserver {
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
+ // hierarchy. We then insert and remove TabContents GtkWidgets into this
// vbox_.
GtkWidget* vbox_;