OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 InstantCompleteBehavior behavior) OVERRIDE; | 137 InstantCompleteBehavior behavior) OVERRIDE; |
138 virtual string16 GetInputString() const OVERRIDE; | 138 virtual string16 GetInputString() const OVERRIDE; |
139 virtual WindowOpenDisposition GetWindowOpenDisposition() const OVERRIDE; | 139 virtual WindowOpenDisposition GetWindowOpenDisposition() const OVERRIDE; |
140 virtual content::PageTransition GetPageTransition() const OVERRIDE; | 140 virtual content::PageTransition GetPageTransition() const OVERRIDE; |
141 virtual void AcceptInput() OVERRIDE; | 141 virtual void AcceptInput() OVERRIDE; |
142 virtual void FocusLocation(bool select_all) OVERRIDE; | 142 virtual void FocusLocation(bool select_all) OVERRIDE; |
143 virtual void FocusSearch() OVERRIDE; | 143 virtual void FocusSearch() OVERRIDE; |
144 virtual void UpdateContentSettingsIcons() OVERRIDE; | 144 virtual void UpdateContentSettingsIcons() OVERRIDE; |
145 virtual void UpdatePageActions() OVERRIDE; | 145 virtual void UpdatePageActions() OVERRIDE; |
146 virtual void InvalidatePageActions() OVERRIDE; | 146 virtual void InvalidatePageActions() OVERRIDE; |
147 virtual void UpdateWebIntentsTool() OVERRIDE; | |
Bernhard Bauer
2012/07/24 20:37:03
Is this method actually called from outside of thi
| |
147 virtual void SaveStateToContents(content::WebContents* contents) OVERRIDE; | 148 virtual void SaveStateToContents(content::WebContents* contents) OVERRIDE; |
148 virtual void Revert() OVERRIDE; | 149 virtual void Revert() OVERRIDE; |
149 virtual const OmniboxView* GetLocationEntry() const OVERRIDE; | 150 virtual const OmniboxView* GetLocationEntry() const OVERRIDE; |
150 virtual OmniboxView* GetLocationEntry() OVERRIDE; | 151 virtual OmniboxView* GetLocationEntry() OVERRIDE; |
151 virtual LocationBarTesting* GetLocationBarForTesting() OVERRIDE; | 152 virtual LocationBarTesting* GetLocationBarForTesting() OVERRIDE; |
152 | 153 |
153 // LocationBarTesting: | 154 // LocationBarTesting: |
154 virtual int PageActionCount() OVERRIDE; | 155 virtual int PageActionCount() OVERRIDE; |
155 virtual int PageActionVisibleCount() OVERRIDE; | 156 virtual int PageActionVisibleCount() OVERRIDE; |
156 virtual ExtensionAction* GetPageAction(size_t index) OVERRIDE; | 157 virtual ExtensionAction* GetPageAction(size_t index) OVERRIDE; |
157 virtual ExtensionAction* GetVisiblePageAction(size_t index) OVERRIDE; | 158 virtual ExtensionAction* GetVisiblePageAction(size_t index) OVERRIDE; |
158 virtual void TestPageActionPressed(size_t index) OVERRIDE; | 159 virtual void TestPageActionPressed(size_t index) OVERRIDE; |
159 | 160 |
160 // content::NotificationObserver: | 161 // content::NotificationObserver: |
161 virtual void Observe(int type, | 162 virtual void Observe(int type, |
162 const content::NotificationSource& source, | 163 const content::NotificationSource& source, |
163 const content::NotificationDetails& details) OVERRIDE; | 164 const content::NotificationDetails& details) OVERRIDE; |
164 | 165 |
165 // CommandObserver: | 166 // CommandObserver: |
166 virtual void EnabledStateChangedForCommand(int id, bool enabled) OVERRIDE; | 167 virtual void EnabledStateChangedForCommand(int id, bool enabled) OVERRIDE; |
167 | 168 |
168 // Edit background color. | 169 // Edit background color. |
169 static const GdkColor kBackgroundColor; | 170 static const GdkColor kBackgroundColor; |
170 | 171 |
171 private: | 172 private: |
173 // TODO(gbillock): cause this public interface to be a platform-independent | |
174 // model interface for all the tools displayed in the location bar. | |
Bernhard Bauer
2012/07/24 20:37:03
Can you explain what this class does? IIUC, at the
| |
175 class PageToolViewGtk : public ui::AnimationDelegate { | |
176 public: | |
177 PageToolViewGtk(const LocationBarViewGtk* parent); | |
178 virtual ~PageToolViewGtk(); | |
179 | |
180 GtkWidget* widget(); | |
181 | |
182 bool IsVisible(); | |
183 void Update(TabContents* tab_contents); // TODO(gbillock): make TC const | |
184 | |
185 // Overridden from ui::AnimationDelegate: | |
186 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | |
187 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; | |
188 virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; | |
189 | |
190 private: | |
191 // Start the process of showing the label. | |
192 void StartAnimating(); | |
193 | |
194 CHROMEGTK_CALLBACK_1(PageToolViewGtk, gboolean, OnButtonPressed, GdkEvent*); | |
195 CHROMEGTK_CALLBACK_1(PageToolViewGtk, gboolean, OnExpose, GdkEventExpose*); | |
196 | |
197 // The widgets for this view. | |
198 ui::OwnedWidgetGtk alignment_; | |
199 ui::OwnedWidgetGtk event_box_; | |
200 GtkWidget* hbox_; | |
201 ui::OwnedWidgetGtk image_; | |
202 | |
203 // Explanatory text (e.g. "popup blocked"). | |
204 ui::OwnedWidgetGtk label_; | |
205 | |
206 // The owning LocationBarViewGtk. | |
207 const LocationBarViewGtk* parent_; | |
208 | |
209 // When we show explanatory text, we slide it in/out. | |
210 ui::SlideAnimation animation_; | |
211 | |
212 // The label's default requisition (cached so we can animate accordingly). | |
213 GtkRequisition label_req_; | |
214 | |
215 base::WeakPtrFactory<PageToolViewGtk> weak_factory_; | |
Bernhard Bauer
2012/07/24 20:37:03
Is this used?
| |
216 | |
217 DISALLOW_COPY_AND_ASSIGN(PageToolViewGtk); | |
218 }; | |
219 | |
172 class ContentSettingImageViewGtk : public BubbleDelegateGtk, | 220 class ContentSettingImageViewGtk : public BubbleDelegateGtk, |
173 public ui::AnimationDelegate { | 221 public ui::AnimationDelegate { |
174 public: | 222 public: |
175 ContentSettingImageViewGtk(ContentSettingsType content_type, | 223 ContentSettingImageViewGtk(ContentSettingsType content_type, |
176 const LocationBarViewGtk* parent); | 224 const LocationBarViewGtk* parent); |
177 virtual ~ContentSettingImageViewGtk(); | 225 virtual ~ContentSettingImageViewGtk(); |
178 | 226 |
179 GtkWidget* widget() { return alignment_.get(); } | 227 GtkWidget* widget() { return alignment_.get(); } |
180 | 228 |
181 bool IsVisible(); | 229 bool IsVisible(); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
464 ui::OwnedWidgetGtk content_setting_hbox_; | 512 ui::OwnedWidgetGtk content_setting_hbox_; |
465 ScopedVector<ContentSettingImageViewGtk> content_setting_views_; | 513 ScopedVector<ContentSettingImageViewGtk> content_setting_views_; |
466 | 514 |
467 // Extension page actions. | 515 // Extension page actions. |
468 std::vector<ExtensionAction*> page_actions_; | 516 std::vector<ExtensionAction*> page_actions_; |
469 | 517 |
470 // Extension page action icons. | 518 // Extension page action icons. |
471 ui::OwnedWidgetGtk page_action_hbox_; | 519 ui::OwnedWidgetGtk page_action_hbox_; |
472 ScopedVector<PageActionViewGtk> page_action_views_; | 520 ScopedVector<PageActionViewGtk> page_action_views_; |
473 | 521 |
522 // Control for web intents window disposition picker control. | |
523 ui::OwnedWidgetGtk web_intents_hbox_; | |
524 PageToolViewGtk web_intents_tool_view_; | |
525 | |
474 // The widget that contains our tab hints and the location bar. | 526 // The widget that contains our tab hints and the location bar. |
475 GtkWidget* entry_box_; | 527 GtkWidget* entry_box_; |
476 | 528 |
477 // Area on the left shown when in tab to search mode. | 529 // Area on the left shown when in tab to search mode. |
478 GtkWidget* tab_to_search_alignment_; | 530 GtkWidget* tab_to_search_alignment_; |
479 GtkWidget* tab_to_search_box_; | 531 GtkWidget* tab_to_search_box_; |
480 GtkWidget* tab_to_search_magnifier_; | 532 GtkWidget* tab_to_search_magnifier_; |
481 GtkWidget* tab_to_search_full_label_; | 533 GtkWidget* tab_to_search_full_label_; |
482 GtkWidget* tab_to_search_partial_label_; | 534 GtkWidget* tab_to_search_partial_label_; |
483 | 535 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
539 BooleanPrefMember edit_bookmarks_enabled_; | 591 BooleanPrefMember edit_bookmarks_enabled_; |
540 | 592 |
541 // Used to remember the URL and title text when drag&drop has begun. | 593 // Used to remember the URL and title text when drag&drop has begun. |
542 GURL drag_url_; | 594 GURL drag_url_; |
543 string16 drag_title_; | 595 string16 drag_title_; |
544 | 596 |
545 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); | 597 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); |
546 }; | 598 }; |
547 | 599 |
548 #endif // CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ | 600 #endif // CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
OLD | NEW |