summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/location_bar_view_gtk.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 23:51:24 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 23:51:24 +0000
commit00642a43c6e1b37d6ba869fc8ba0256e8958b761 (patch)
tree5b7e52264b0a458a922243b8089c0f4a56363530 /chrome/browser/gtk/location_bar_view_gtk.cc
parentebd0eae7d02753d5ec82a22c13a5f16d1ca23700 (diff)
downloadchromium_src-00642a43c6e1b37d6ba869fc8ba0256e8958b761.zip
chromium_src-00642a43c6e1b37d6ba869fc8ba0256e8958b761.tar.gz
chromium_src-00642a43c6e1b37d6ba869fc8ba0256e8958b761.tar.bz2
GTK: Content blocking icon visibility should change on tab switching.
BUG=35861 TEST=none Review URL: http://codereview.chromium.org/612001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39160 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/location_bar_view_gtk.cc')
-rw-r--r--chrome/browser/gtk/location_bar_view_gtk.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc
index 49e8929..073d498 100644
--- a/chrome/browser/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/gtk/location_bar_view_gtk.cc
@@ -395,6 +395,7 @@ GtkWidget* LocationBarViewGtk::GetPageActionWidget(
void LocationBarViewGtk::Update(const TabContents* contents) {
SetSecurityIcon(toolbar_model_->GetIcon());
+ UpdateContentBlockedIcons();
UpdatePageActions();
SetInfoText();
location_entry_->Update(contents);
@@ -538,12 +539,22 @@ void LocationBarViewGtk::FocusSearch() {
void LocationBarViewGtk::UpdateContentBlockedIcons() {
const TabContents* tab_contents = GetTabContents();
+ bool any_visible = false;
for (ScopedVector<ContentBlockedViewGtk>::iterator i(
content_blocked_views_.begin());
i != content_blocked_views_.end(); ++i) {
- (*i)->SetVisible((!toolbar_model_->input_in_progress() && tab_contents) ?
- tab_contents->IsContentBlocked((*i)->content_type()) : false);
+ bool is_visible = (!toolbar_model_->input_in_progress() && tab_contents) ?
+ tab_contents->IsContentBlocked((*i)->content_type()) : false;
+ any_visible = is_visible || any_visible;
+ (*i)->SetVisible(is_visible);
}
+
+ // If there are no visible content things, hide the top level box so it
+ // doesn't mess with padding.
+ if (any_visible)
+ gtk_widget_show(content_blocking_hbox_.get());
+ else
+ gtk_widget_hide(content_blocking_hbox_.get());
}
void LocationBarViewGtk::UpdatePageActions() {