Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: chrome/browser/gtk/browser_actions_toolbar_gtk.cc

Issue 1167004: Adds the source ImageLoadingTracker to OnImageLoaded. I need this in a (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chrome/browser/gtk/browser_actions_toolbar_gtk.h" 5 #include "chrome/browser/gtk/browser_actions_toolbar_gtk.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "app/gfx/canvas_paint.h" 9 #include "app/gfx/canvas_paint.h"
10 #include "chrome/browser/browser.h" 10 #include "chrome/browser/browser.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void Observe(NotificationType type, 124 void Observe(NotificationType type,
125 const NotificationSource& source, 125 const NotificationSource& source,
126 const NotificationDetails& details) { 126 const NotificationDetails& details) {
127 if (type == NotificationType::EXTENSION_BROWSER_ACTION_UPDATED) 127 if (type == NotificationType::EXTENSION_BROWSER_ACTION_UPDATED)
128 UpdateState(); 128 UpdateState();
129 else 129 else
130 NOTREACHED(); 130 NOTREACHED();
131 } 131 }
132 132
133 // ImageLoadingTracker::Observer implementation. 133 // ImageLoadingTracker::Observer implementation.
134 void OnImageLoaded(SkBitmap* image, size_t index) { 134 void OnImageLoaded(ImageLoadingTracker* source, SkBitmap* image,
135 size_t index) {
135 if (image) { 136 if (image) {
136 default_skbitmap_ = *image; 137 default_skbitmap_ = *image;
137 default_icon_ = gfx::GdkPixbufFromSkBitmap(image); 138 default_icon_ = gfx::GdkPixbufFromSkBitmap(image);
138 } 139 }
139 tracker_ = NULL; // The tracker object will delete itself when we return. 140 tracker_ = NULL; // The tracker object will delete itself when we return.
140 UpdateState(); 141 UpdateState();
141 } 142 }
142 143
143 // Updates the button based on the latest state from the associated 144 // Updates the button based on the latest state from the associated
144 // browser action. 145 // browser action.
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 742
742 // TODO(estade): set the menu item's tooltip. 743 // TODO(estade): set the menu item's tooltip.
743 } 744 }
744 745
745 gtk_chrome_button_set_paint_state(GTK_CHROME_BUTTON(overflow), 746 gtk_chrome_button_set_paint_state(GTK_CHROME_BUTTON(overflow),
746 GTK_STATE_ACTIVE); 747 GTK_STATE_ACTIVE);
747 overflow_menu_->PopupAsFromKeyEvent(overflow); 748 overflow_menu_->PopupAsFromKeyEvent(overflow);
748 749
749 return FALSE; 750 return FALSE;
750 } 751 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/image_loading_tracker.cc ('k') | chrome/browser/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698