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

Side by Side Diff: chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.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/omnibox/omnibox_popup_view_gtk.h" 5 #include "chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 495
496 const gfx::Image* OmniboxPopupViewGtk::IconForMatch( 496 const gfx::Image* OmniboxPopupViewGtk::IconForMatch(
497 const AutocompleteMatch& match, 497 const AutocompleteMatch& match,
498 bool selected, 498 bool selected,
499 bool is_selected_keyword) { 499 bool is_selected_keyword) {
500 const SkBitmap* bitmap = model_->GetIconIfExtensionMatch(match); 500 const SkBitmap* bitmap = model_->GetIconIfExtensionMatch(match);
501 if (bitmap) { 501 if (bitmap) {
502 if (!ContainsKey(images_, bitmap)) { 502 if (!ContainsKey(images_, bitmap)) {
503 // gfx::Image wants ownership of bitmaps given to it, and we might as 503 // gfx::Image wants ownership of bitmaps given to it, and we might as
504 // well make the bitmap copy a format that will be used. 504 // well make the bitmap copy a format that will be used.
505 images_[bitmap] = new gfx::Image(gfx::GdkPixbufFromSkBitmap(bitmap)); 505 images_[bitmap] = new gfx::Image(gfx::GdkPixbufFromSkBitmap(*bitmap));
506 } 506 }
507 return images_[bitmap]; 507 return images_[bitmap];
508 } 508 }
509 509
510 int icon; 510 int icon;
511 if (is_selected_keyword) 511 if (is_selected_keyword)
512 icon = IDR_OMNIBOX_TTS; 512 icon = IDR_OMNIBOX_TTS;
513 else if (match.starred) 513 else if (match.starred)
514 icon = IDR_OMNIBOX_STAR; 514 icon = IDR_OMNIBOX_STAR;
515 else 515 else
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 DrawFullImage(cr, widget, 741 DrawFullImage(cr, widget,
742 theme_service_->GetImageNamed( 742 theme_service_->GetImageNamed(
743 is_selected ? IDR_OMNIBOX_TTS_DARK : IDR_OMNIBOX_TTS), 743 is_selected ? IDR_OMNIBOX_TTS_DARK : IDR_OMNIBOX_TTS),
744 icon_start_x, line_rect.y() + kIconTopPadding); 744 icon_start_x, line_rect.y() + kIconTopPadding);
745 } 745 }
746 } 746 }
747 747
748 cairo_destroy(cr); 748 cairo_destroy(cr);
749 return TRUE; 749 return TRUE;
750 } 750 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/menu_gtk.cc ('k') | chrome/browser/ui/gtk/status_icons/status_icon_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698