diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 21:10:38 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 21:10:38 +0000 |
commit | d7313ce9aecaed59829e57bf12521eaf135e5f74 (patch) | |
tree | ec6762fad10912ab698397856f67d37709c97ff2 /chrome/browser/gtk/location_bar_view_gtk.h | |
parent | be82dced35dab699b978c6b9f256f78b3ee99900 (diff) | |
download | chromium_src-d7313ce9aecaed59829e57bf12521eaf135e5f74.zip chromium_src-d7313ce9aecaed59829e57bf12521eaf135e5f74.tar.gz chromium_src-d7313ce9aecaed59829e57bf12521eaf135e5f74.tar.bz2 |
GTK: Implement the new content blocking address bar bubbles on Linux.
BUG=33314
TEST=none
Review URL: http://codereview.chromium.org/573023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38246 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/location_bar_view_gtk.h')
-rw-r--r-- | chrome/browser/gtk/location_bar_view_gtk.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/chrome/browser/gtk/location_bar_view_gtk.h b/chrome/browser/gtk/location_bar_view_gtk.h index 112aeba..6e6cfb5 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.h +++ b/chrome/browser/gtk/location_bar_view_gtk.h @@ -16,8 +16,10 @@ #include "chrome/browser/autocomplete/autocomplete_edit.h" #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" #include "chrome/browser/extensions/image_loading_tracker.h" +#include "chrome/browser/gtk/info_bubble_gtk.h" #include "chrome/browser/gtk/menu_gtk.h" #include "chrome/browser/location_bar.h" +#include "chrome/common/content_settings_types.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/owned_widget_gtk.h" @@ -29,6 +31,7 @@ class AutocompleteEditViewGtk; class BubblePositioner; class Browser; class CommandUpdater; +class ContentBlockedBubbleGtk; class ExtensionAction; class ExtensionActionContextMenuModel; class GtkThemeProvider; @@ -120,6 +123,52 @@ class LocationBarViewGtk : public AutocompleteEditController, static const GdkColor kBackgroundColorByLevel[3]; private: + class ContentBlockedViewGtk : public InfoBubbleGtkDelegate { + public: + ContentBlockedViewGtk(ContentSettingsType content_type, + const LocationBarViewGtk* parent, + Profile* profile); + virtual ~ContentBlockedViewGtk(); + + GtkWidget* widget() { return event_box_.get(); } + + ContentSettingsType content_type() const { return content_type_; } + void set_profile(Profile* profile) { profile_ = profile; } + + bool IsVisible() { return GTK_WIDGET_VISIBLE(widget()); } + void SetVisible(bool visible); + + private: + static gboolean OnButtonPressedThunk(GtkWidget* sender, + GdkEvent* event, + ContentBlockedViewGtk* view) { + return view->OnButtonPressed(sender, event); + } + gboolean OnButtonPressed(GtkWidget* sender, GdkEvent* event); + + // InfoBubbleDelegate overrides: + virtual void InfoBubbleClosing(InfoBubbleGtk* info_bubble, + bool closed_by_escape); + + // The widgets for this content blocked view. + OwnedWidgetGtk event_box_; + OwnedWidgetGtk image_; + + // The type of content handled by this view. + ContentSettingsType content_type_; + + // The owning LocationBarViewGtk. + const LocationBarViewGtk* parent_; + + // The currently active profile. + Profile* profile_; + + // The currently shown info bubble if any. + ContentBlockedBubbleGtk* info_bubble_; + + DISALLOW_COPY_AND_ASSIGN(ContentBlockedViewGtk); + }; + class PageActionViewGtk : public ImageLoadingTracker::Observer { public: PageActionViewGtk( @@ -261,6 +310,10 @@ class LocationBarViewGtk : public AutocompleteEditController, // Toolbar info text (EV cert info). GtkWidget* info_label_; + // Content blocking icons. + OwnedWidgetGtk content_blocking_hbox_; + ScopedVector<ContentBlockedViewGtk> content_blocked_views_; + // Extension page action icons. OwnedWidgetGtk page_action_hbox_; ScopedVector<PageActionViewGtk> page_action_views_; |