OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_GTK_LOCATION_BAR_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ |
6 #define CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 } | 186 } |
187 | 187 |
188 bool IsVisible() { return GTK_WIDGET_VISIBLE(widget()); } | 188 bool IsVisible() { return GTK_WIDGET_VISIBLE(widget()); } |
189 | 189 |
190 // Called to notify the PageAction that it should determine whether to be | 190 // Called to notify the PageAction that it should determine whether to be |
191 // visible or hidden. |contents| is the TabContents that is active, |url| | 191 // visible or hidden. |contents| is the TabContents that is active, |url| |
192 // is the current page URL. | 192 // is the current page URL. |
193 void UpdateVisibility(TabContents* contents, GURL url); | 193 void UpdateVisibility(TabContents* contents, GURL url); |
194 | 194 |
195 // A callback from ImageLoadingTracker for when the image has loaded. | 195 // A callback from ImageLoadingTracker for when the image has loaded. |
196 virtual void OnImageLoaded(SkBitmap* image, size_t index); | 196 virtual void OnImageLoaded(SkBitmap* image, int index); |
197 | 197 |
198 // Simulate left mouse click on the page action button. | 198 // Simulate left mouse click on the page action button. |
199 void TestActivatePageAction(); | 199 void TestActivatePageAction(); |
200 | 200 |
201 // Overridden from ExtensionContextMenuModel::PopupDelegate: | 201 // Overridden from ExtensionContextMenuModel::PopupDelegate: |
202 virtual void InspectPopup(ExtensionAction* action); | 202 virtual void InspectPopup(ExtensionAction* action); |
203 | 203 |
204 private: | 204 private: |
205 static gboolean OnButtonPressedThunk(GtkWidget* sender, | 205 static gboolean OnButtonPressedThunk(GtkWidget* sender, |
206 GdkEvent* event, | 206 GdkEvent* event, |
(...skipping 23 matching lines...) Expand all Loading... |
230 typedef std::map<std::string, GdkPixbuf*> PixbufMap; | 230 typedef std::map<std::string, GdkPixbuf*> PixbufMap; |
231 PixbufMap pixbufs_; | 231 PixbufMap pixbufs_; |
232 | 232 |
233 // A cache of the last dynamically generated bitmap and the pixbuf that | 233 // A cache of the last dynamically generated bitmap and the pixbuf that |
234 // corresponds to it. We keep track of both so we can free old pixbufs as | 234 // corresponds to it. We keep track of both so we can free old pixbufs as |
235 // their icons are replaced. | 235 // their icons are replaced. |
236 SkBitmap last_icon_skbitmap_; | 236 SkBitmap last_icon_skbitmap_; |
237 GdkPixbuf* last_icon_pixbuf_; | 237 GdkPixbuf* last_icon_pixbuf_; |
238 | 238 |
239 // The object that is waiting for the image loading to complete | 239 // The object that is waiting for the image loading to complete |
240 // asynchronously. It will delete itself once it is done. | 240 // asynchronously. |
241 ImageLoadingTracker* tracker_; | 241 ImageLoadingTracker tracker_; |
242 | 242 |
243 // The widgets for this page action. | 243 // The widgets for this page action. |
244 OwnedWidgetGtk event_box_; | 244 OwnedWidgetGtk event_box_; |
245 OwnedWidgetGtk image_; | 245 OwnedWidgetGtk image_; |
246 | 246 |
247 // The tab id we are currently showing the icon for. | 247 // The tab id we are currently showing the icon for. |
248 int current_tab_id_; | 248 int current_tab_id_; |
249 | 249 |
250 // The URL we are currently showing the icon for. | 250 // The URL we are currently showing the icon for. |
251 GURL current_url_; | 251 GURL current_url_; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 // Indicate if |tab_to_search_hint_| should be shown. | 379 // Indicate if |tab_to_search_hint_| should be shown. |
380 bool show_keyword_hint_; | 380 bool show_keyword_hint_; |
381 | 381 |
382 // Indicate if |type_to_search_hint_| should be shown. | 382 // Indicate if |type_to_search_hint_| should be shown. |
383 bool show_search_hint_; | 383 bool show_search_hint_; |
384 | 384 |
385 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); | 385 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); |
386 }; | 386 }; |
387 | 387 |
388 #endif // CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ | 388 #endif // CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ |
OLD | NEW |