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( |
| 197 SkBitmap* image, ExtensionResource resource, int index); |
197 | 198 |
198 // Simulate left mouse click on the page action button. | 199 // Simulate left mouse click on the page action button. |
199 void TestActivatePageAction(); | 200 void TestActivatePageAction(); |
200 | 201 |
201 // Overridden from ExtensionContextMenuModel::PopupDelegate: | 202 // Overridden from ExtensionContextMenuModel::PopupDelegate: |
202 virtual void InspectPopup(ExtensionAction* action); | 203 virtual void InspectPopup(ExtensionAction* action); |
203 | 204 |
204 private: | 205 private: |
205 static gboolean OnButtonPressedThunk(GtkWidget* sender, | 206 static gboolean OnButtonPressedThunk(GtkWidget* sender, |
206 GdkEvent* event, | 207 GdkEvent* event, |
(...skipping 23 matching lines...) Expand all Loading... |
230 typedef std::map<std::string, GdkPixbuf*> PixbufMap; | 231 typedef std::map<std::string, GdkPixbuf*> PixbufMap; |
231 PixbufMap pixbufs_; | 232 PixbufMap pixbufs_; |
232 | 233 |
233 // A cache of the last dynamically generated bitmap and the pixbuf that | 234 // 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 | 235 // corresponds to it. We keep track of both so we can free old pixbufs as |
235 // their icons are replaced. | 236 // their icons are replaced. |
236 SkBitmap last_icon_skbitmap_; | 237 SkBitmap last_icon_skbitmap_; |
237 GdkPixbuf* last_icon_pixbuf_; | 238 GdkPixbuf* last_icon_pixbuf_; |
238 | 239 |
239 // The object that is waiting for the image loading to complete | 240 // The object that is waiting for the image loading to complete |
240 // asynchronously. It will delete itself once it is done. | 241 // asynchronously. |
241 ImageLoadingTracker* tracker_; | 242 ImageLoadingTracker tracker_; |
242 | 243 |
243 // The widgets for this page action. | 244 // The widgets for this page action. |
244 OwnedWidgetGtk event_box_; | 245 OwnedWidgetGtk event_box_; |
245 OwnedWidgetGtk image_; | 246 OwnedWidgetGtk image_; |
246 | 247 |
247 // The tab id we are currently showing the icon for. | 248 // The tab id we are currently showing the icon for. |
248 int current_tab_id_; | 249 int current_tab_id_; |
249 | 250 |
250 // The URL we are currently showing the icon for. | 251 // The URL we are currently showing the icon for. |
251 GURL current_url_; | 252 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. | 380 // Indicate if |tab_to_search_hint_| should be shown. |
380 bool show_keyword_hint_; | 381 bool show_keyword_hint_; |
381 | 382 |
382 // Indicate if |type_to_search_hint_| should be shown. | 383 // Indicate if |type_to_search_hint_| should be shown. |
383 bool show_search_hint_; | 384 bool show_search_hint_; |
384 | 385 |
385 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); | 386 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); |
386 }; | 387 }; |
387 | 388 |
388 #endif // CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ | 389 #endif // CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ |
OLD | NEW |