Index: chrome/browser/ui/gtk/location_bar_view_gtk.h |
diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.h b/chrome/browser/ui/gtk/location_bar_view_gtk.h |
index 8ecfa8461d1601528b71f055a955254406af95d4..da053927cb2c27359709ac318813d302a4c2d915 100644 |
--- a/chrome/browser/ui/gtk/location_bar_view_gtk.h |
+++ b/chrome/browser/ui/gtk/location_bar_view_gtk.h |
@@ -144,6 +144,7 @@ class LocationBarViewGtk : public OmniboxEditController, |
virtual void UpdateContentSettingsIcons() OVERRIDE; |
virtual void UpdatePageActions() OVERRIDE; |
virtual void InvalidatePageActions() OVERRIDE; |
+ virtual void UpdateWebIntentsTool() OVERRIDE; |
virtual void SaveStateToContents(content::WebContents* contents) OVERRIDE; |
virtual void Revert() OVERRIDE; |
virtual const OmniboxView* GetLocationEntry() const OVERRIDE; |
@@ -169,63 +170,90 @@ class LocationBarViewGtk : public OmniboxEditController, |
static const GdkColor kBackgroundColor; |
private: |
- class ContentSettingImageViewGtk : public BubbleDelegateGtk, |
- public ui::AnimationDelegate { |
+ // TODO(gbillock): cause this public interface to be a platform-independent |
+ // model interface for all the tools displayed in the location bar. |
+ class PageToolViewGtk : public ui::AnimationDelegate { |
public: |
- ContentSettingImageViewGtk(ContentSettingsType content_type, |
- const LocationBarViewGtk* parent); |
- virtual ~ContentSettingImageViewGtk(); |
+ PageToolViewGtk(const LocationBarViewGtk* parent); |
+ virtual ~PageToolViewGtk(); |
- GtkWidget* widget() { return alignment_.get(); } |
+ GtkWidget* widget(); |
bool IsVisible(); |
- void UpdateFromWebContents(content::WebContents* web_contents); |
+ virtual void Update(TabContents* tab_contents); |
// Overridden from ui::AnimationDelegate: |
virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; |
virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; |
- private: |
+ protected: |
+ // Theme constants for solid background elements. |
+ virtual GdkColor button_border_color() const; |
+ virtual GdkColor gradient_top_color() const; |
+ virtual GdkColor gradient_bottom_color() const; |
+ |
// Start the process of showing the label. |
void StartAnimating(); |
// Slide the label shut. |
void CloseAnimation(); |
- CHROMEGTK_CALLBACK_1(ContentSettingImageViewGtk, gboolean, OnButtonPressed, |
- GdkEvent*); |
- CHROMEGTK_CALLBACK_1(ContentSettingImageViewGtk, gboolean, OnExpose, |
- GdkEventExpose*); |
+ CHROMEGTK_CALLBACK_1(PageToolViewGtk, gboolean, OnButtonPressed, GdkEvent*); |
+ CHROMEGTK_CALLBACK_1(PageToolViewGtk, gboolean, OnExpose, GdkEventExpose*); |
- // BubbleDelegateGtk overrides: |
- virtual void BubbleClosing(BubbleGtk* bubble, |
- bool closed_by_escape) OVERRIDE; |
+ // Delegate for ButtonPressed message. |
+ virtual void OnClick(GtkWidget* sender); |
- scoped_ptr<ContentSettingImageModel> content_setting_image_model_; |
- |
- // The widgets for this content settings view. |
+ // The widgets for this view. |
ui::OwnedWidgetGtk alignment_; |
ui::OwnedWidgetGtk event_box_; |
GtkWidget* hbox_; |
ui::OwnedWidgetGtk image_; |
- // Explanatory text ("popup blocked"). |
+ // Explanatory text (e.g. "popup blocked"). |
ui::OwnedWidgetGtk label_; |
// The owning LocationBarViewGtk. |
const LocationBarViewGtk* parent_; |
- // The currently shown bubble if any. |
- ContentSettingBubbleGtk* content_setting_bubble_; |
- |
// When we show explanatory text, we slide it in/out. |
ui::SlideAnimation animation_; |
// The label's default requisition (cached so we can animate accordingly). |
GtkRequisition label_req_; |
- base::WeakPtrFactory<ContentSettingImageViewGtk> weak_factory_; |
+ base::WeakPtrFactory<PageToolViewGtk> weak_factory_; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(PageToolViewGtk); |
+ }; |
+ |
+ class ContentSettingImageViewGtk : public PageToolViewGtk, |
+ public BubbleDelegateGtk { |
+ public: |
+ ContentSettingImageViewGtk(ContentSettingsType content_type, |
+ const LocationBarViewGtk* parent); |
+ virtual ~ContentSettingImageViewGtk(); |
+ |
+ virtual void Update(TabContents* tab_contents) OVERRIDE; |
Bernhard Bauer
2012/07/27 00:35:38
Add a comment which class this overrides?
|
+ |
+ virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; |
+ |
+ private: |
+ virtual GdkColor button_border_color() const OVERRIDE; |
+ virtual GdkColor gradient_top_color() const OVERRIDE; |
+ virtual GdkColor gradient_bottom_color() const OVERRIDE; |
+ virtual void OnClick(GtkWidget* sender) OVERRIDE; |
+ |
+ // BubbleDelegateGtk overrides: |
+ virtual void BubbleClosing(BubbleGtk* bubble, |
+ bool closed_by_escape) OVERRIDE; |
+ |
+ scoped_ptr<ContentSettingImageModel> content_setting_image_model_; |
+ |
+ // The currently shown bubble if any. |
+ ContentSettingBubbleGtk* content_setting_bubble_; |
DISALLOW_COPY_AND_ASSIGN(ContentSettingImageViewGtk); |
}; |
@@ -471,6 +499,10 @@ class LocationBarViewGtk : public OmniboxEditController, |
ui::OwnedWidgetGtk page_action_hbox_; |
ScopedVector<PageActionViewGtk> page_action_views_; |
+ // Control for web intents window disposition picker control. |
+ ui::OwnedWidgetGtk web_intents_hbox_; |
+ PageToolViewGtk web_intents_tool_view_; |
+ |
// The widget that contains our tab hints and the location bar. |
GtkWidget* entry_box_; |