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

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

Issue 10377122: Convert GdkPixbufFromSkBitmap and GdkPixbufToSkBitmap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/gtk_tree.h" 5 #include "chrome/browser/ui/gtk/gtk_tree.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/ui/gtk/gtk_theme_service.h" 9 #include "chrome/browser/ui/gtk/gtk_theme_service.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 tree_model_(tree_model) { 347 tree_model_(tree_model) {
348 tree_store_ = gtk_tree_store_new(COL_COUNT, 348 tree_store_ = gtk_tree_store_new(COL_COUNT,
349 GDK_TYPE_PIXBUF, 349 GDK_TYPE_PIXBUF,
350 G_TYPE_STRING, 350 G_TYPE_STRING,
351 G_TYPE_POINTER); 351 G_TYPE_POINTER);
352 tree_model->AddObserver(this); 352 tree_model->AddObserver(this);
353 353
354 std::vector<SkBitmap> icons; 354 std::vector<SkBitmap> icons;
355 tree_model->GetIcons(&icons); 355 tree_model->GetIcons(&icons);
356 for (size_t i = 0; i < icons.size(); ++i) { 356 for (size_t i = 0; i < icons.size(); ++i) {
357 pixbufs_.push_back(gfx::GdkPixbufFromSkBitmap(&icons[i])); 357 pixbufs_.push_back(gfx::GdkPixbufFromSkBitmap(icons[i]));
358 } 358 }
359 } 359 }
360 360
361 TreeAdapter::~TreeAdapter() { 361 TreeAdapter::~TreeAdapter() {
362 g_object_unref(tree_store_); 362 g_object_unref(tree_store_);
363 for (size_t i = 0; i < pixbufs_.size(); ++i) 363 for (size_t i = 0; i < pixbufs_.size(); ++i)
364 g_object_unref(pixbufs_[i]); 364 g_object_unref(pixbufs_[i]);
365 } 365 }
366 366
367 void TreeAdapter::Init() { 367 void TreeAdapter::Init() {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 void TreeAdapter::TreeNodeChanged(ui::TreeModel* model, 467 void TreeAdapter::TreeNodeChanged(ui::TreeModel* model,
468 ui::TreeModelNode* node) { 468 ui::TreeModelNode* node) {
469 delegate_->OnAnyModelUpdateStart(); 469 delegate_->OnAnyModelUpdateStart();
470 GtkTreeIter iter; 470 GtkTreeIter iter;
471 if (GetTreeIter(node, &iter)) 471 if (GetTreeIter(node, &iter))
472 FillRow(&iter, node); 472 FillRow(&iter, node);
473 delegate_->OnAnyModelUpdate(); 473 delegate_->OnAnyModelUpdate();
474 } 474 }
475 475
476 } // namespace gtk_tree 476 } // namespace gtk_tree
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/gtk_theme_service.cc ('k') | chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698