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

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

Issue 10827191: Convert extension action icons code to use ImageSkia instead of SkBitmap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove includes we don't need anymore Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h" 5 #include "chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 242
243 gfx::Image image = extension_->browser_action()->GetIcon(tab_id); 243 gfx::Image image = extension_->browser_action()->GetIcon(tab_id);
244 if (!image.IsEmpty()) 244 if (!image.IsEmpty())
245 SetImage(image.ToGdkPixbuf()); 245 SetImage(image.ToGdkPixbuf());
246 bool enabled = extension_->browser_action()->GetIsVisible(tab_id); 246 bool enabled = extension_->browser_action()->GetIsVisible(tab_id);
247 gtk_widget_set_sensitive(button(), enabled); 247 gtk_widget_set_sensitive(button(), enabled);
248 248
249 gtk_widget_queue_draw(button()); 249 gtk_widget_queue_draw(button());
250 } 250 }
251 251
252 SkBitmap GetIcon() { 252 gfx::ImageSkia GetIcon() {
Jeffrey Yasskin 2012/08/09 21:39:04 Out of curiosity, why return ImageSkia instead of
tbarzic 2012/08/10 06:24:08 Code that uses return value asks for ImageSkia, so
253 return *extension_->browser_action()->GetIcon( 253 return *extension_->browser_action()->GetIcon(
254 toolbar_->GetCurrentTabId()).ToSkBitmap(); 254 toolbar_->GetCurrentTabId()).ToImageSkia();
255 } 255 }
256 256
257 MenuGtk* GetContextMenu() { 257 MenuGtk* GetContextMenu() {
258 if (!extension_->ShowConfigureContextMenus()) 258 if (!extension_->ShowConfigureContextMenus())
259 return NULL; 259 return NULL;
260 260
261 context_menu_model_ = 261 context_menu_model_ =
262 new ExtensionContextMenuModel(extension_, toolbar_->browser(), this); 262 new ExtensionContextMenuModel(extension_, toolbar_->browser(), this);
263 context_menu_.reset( 263 context_menu_.reset(
264 new MenuGtk(this, context_menu_model_.get())); 264 new MenuGtk(this, context_menu_model_.get()));
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 1093
1094 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), 1094 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root),
1095 event->time); 1095 event->time);
1096 return TRUE; 1096 return TRUE;
1097 } 1097 }
1098 1098
1099 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { 1099 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) {
1100 if (!resize_animation_.is_animating()) 1100 if (!resize_animation_.is_animating())
1101 UpdateChevronVisibility(); 1101 UpdateChevronVisibility();
1102 } 1102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698