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

Side by Side Diff: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc

Issue 6879013: skia::PlatformCanvas is being deprecated. Going forward we will use gfx::Canvas wherever we need ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/bookmarks/bookmark_utils_gtk.h" 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h"
6 6
7 #include "base/pickle.h" 7 #include "base/pickle.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 cairo_clip(cr); 127 cairo_clip(cr);
128 cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR); 128 cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
129 cairo_paint(cr); 129 cairo_paint(cr);
130 130
131 cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); 131 cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
132 gdk_cairo_set_source_pixbuf(cr, data->favicon, 0, 0); 132 gdk_cairo_set_source_pixbuf(cr, data->favicon, 0, 0);
133 cairo_paint(cr); 133 cairo_paint(cr);
134 cairo_destroy(cr); 134 cairo_destroy(cr);
135 135
136 // Paint the title text. 136 // Paint the title text.
137 gfx::CanvasSkiaPaint canvas(event, false); 137 gfx::CanvasSkiaPaint canvas_paint(event, false);
138 int text_x = gdk_pixbuf_get_width(data->favicon) + kBarButtonPadding; 138 int text_x = gdk_pixbuf_get_width(data->favicon) + kBarButtonPadding;
139 int text_width = sender->allocation.width - text_x; 139 int text_width = sender->allocation.width - text_x;
140 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 140 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
141 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont); 141 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont);
142 canvas.DrawStringInt(data->text, base_font, data->text_color, 142 canvas_paint.AsCanvas()->DrawStringInt(
143 text_x, 0, text_width, sender->allocation.height); 143 data->text, base_font, data->text_color,
144 text_x, 0, text_width, sender->allocation.height);
144 145
145 return TRUE; 146 return TRUE;
146 } 147 }
147 148
148 void OnDragIconDestroy(GtkWidget* drag_icon, 149 void OnDragIconDestroy(GtkWidget* drag_icon,
149 DragRepresentationData* data) { 150 DragRepresentationData* data) {
150 g_object_unref(drag_icon); 151 g_object_unref(drag_icon);
151 delete data; 152 delete data;
152 } 153 }
153 154
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 GURL url; 435 GURL url;
435 string16 title; 436 string16 title;
436 if (!ui::ExtractNetscapeURL(selection_data, &url, &title)) 437 if (!ui::ExtractNetscapeURL(selection_data, &url, &title))
437 return false; 438 return false;
438 439
439 model->AddURL(parent, idx, title, url); 440 model->AddURL(parent, idx, title, url);
440 return true; 441 return true;
441 } 442 }
442 443
443 } // namespace bookmark_utils 444 } // namespace bookmark_utils
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc ('k') | chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698