summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 21:31:39 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 21:31:39 +0000
commit395f9295b3e370746846dbe6073a0d43ab7e4af5 (patch)
tree2b505a988e91b4700268aaba2cdb9601c9122998 /chrome/browser/tab_contents
parent91ed49a3f98ff91be98d786f44da18d4bf182a32 (diff)
downloadchromium_src-395f9295b3e370746846dbe6073a0d43ab7e4af5.zip
chromium_src-395f9295b3e370746846dbe6073a0d43ab7e4af5.tar.gz
chromium_src-395f9295b3e370746846dbe6073a0d43ab7e4af5.tar.bz2
GTK Themes: Theme the popup notification.
TEST=Open popuptest.com in one tab and anything else in another. Switch between GTK theme and normal. Theme of blocked popup container should change, even when not the active tab. http://crbug.com/13967 Review URL: http://codereview.chromium.org/149277 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20085 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_gtk.cc20
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_gtk.h4
2 files changed, 23 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
index 4a64bab..5fe6e38 100644
--- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc
+++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/gtk/constrained_window_gtk.h"
#include "chrome/browser/gtk/gtk_dnd_util.h"
#include "chrome/browser/gtk/gtk_floating_container.h"
+#include "chrome/browser/gtk/gtk_theme_provider.h"
#include "chrome/browser/gtk/sad_tab_gtk.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_view_host_factory.h"
@@ -28,6 +29,7 @@
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
#include "chrome/common/gtk_util.h"
+#include "chrome/common/notification_service.h"
#include "chrome/common/notification_source.h"
#include "chrome/common/notification_type.h"
#include "webkit/glue/webdropdata.h"
@@ -120,7 +122,7 @@ class WebDragDest {
g_signal_connect(widget, "drag-drop",
G_CALLBACK(OnDragDropThunk), this);
g_signal_connect(widget, "drag-data-received",
- G_CALLBACK(OnDragDataReceivedThunk),this);
+ G_CALLBACK(OnDragDataReceivedThunk), this);
destroy_handler_ = g_signal_connect(widget, "destroy",
G_CALLBACK(gtk_widget_destroyed), &widget_);
@@ -320,6 +322,8 @@ TabContentsViewGtk::TabContentsViewGtk(TabContents* tab_contents)
gtk_widget_show(floating_.get());
registrar_.Add(this, NotificationType::TAB_CONTENTS_CONNECTED,
Source<TabContents>(tab_contents));
+ registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED,
+ NotificationService::AllSources());
}
TabContentsViewGtk::~TabContentsViewGtk() {
@@ -541,6 +545,11 @@ void TabContentsViewGtk::Observe(NotificationType type,
sad_tab_.reset();
break;
}
+ case NotificationType::BROWSER_THEME_CHANGED: {
+ GtkThemeProperties properties(tab_contents()->profile());
+ UserChangedTheme(&properties);
+ break;
+ }
default:
NOTREACHED() << "Got a notification we didn't register for.";
break;
@@ -658,6 +667,15 @@ void TabContentsViewGtk::OnDragEnd(GtkWidget* widget,
// -----------------------------------------------------------------------------
+void TabContentsViewGtk::UserChangedTheme(GtkThemeProperties* properties) {
+ if (popup_view_)
+ popup_view_->UserChangedTheme(properties);
+
+ // TODO(erg): Plumb the selected text color, etc from here all the way to
+ // RenderThemeChromiumLinux.cpp in WebKit through our associated
+ // RenderViewHost.
+}
+
void TabContentsViewGtk::InsertIntoContentArea(GtkWidget* widget) {
gtk_fixed_put(GTK_FIXED(fixed_), widget, 0, 0);
}
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.h b/chrome/browser/tab_contents/tab_contents_view_gtk.h
index 897d2b7..aa440d9 100644
--- a/chrome/browser/tab_contents/tab_contents_view_gtk.h
+++ b/chrome/browser/tab_contents/tab_contents_view_gtk.h
@@ -18,6 +18,7 @@
class BlockedPopupContainerViewGtk;
class ConstrainedWindowGtk;
+class GtkThemeProperties;
class RenderViewContextMenuGtk;
class SadTabGtk;
class WebDragDest;
@@ -85,6 +86,9 @@ class TabContentsViewGtk : public TabContentsView,
// Tell webkit the drag is over.
void DragEnded();
+ // Called when the theme is changed.
+ void UserChangedTheme(GtkThemeProperties* properties);
+
// We keep track of the timestamp of the latest mousedown event.
static gboolean OnMouseDown(GtkWidget* widget,
GdkEventButton* event, TabContentsViewGtk* view);