| OLD | NEW |
| 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/bookmark_utils_gtk.h" | 5 #include "chrome/browser/gtk/bookmark_utils_gtk.h" |
| 6 | 6 |
| 7 #include "app/gtk_dnd_util.h" | 7 #include "app/gtk_dnd_util.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(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(UTF16ToWide(data->text), | 142 canvas.DrawStringInt(data->text, base_font, data->text_color, |
| 143 base_font, data->text_color, | |
| 144 text_x, 0, text_width, sender->allocation.height); | 143 text_x, 0, text_width, sender->allocation.height); |
| 145 | 144 |
| 146 return TRUE; | 145 return TRUE; |
| 147 } | 146 } |
| 148 | 147 |
| 149 void OnDragIconDestroy(GtkWidget* drag_icon, | 148 void OnDragIconDestroy(GtkWidget* drag_icon, |
| 150 DragRepresentationData* data) { | 149 DragRepresentationData* data) { |
| 151 g_object_unref(drag_icon); | 150 g_object_unref(drag_icon); |
| 152 delete data; | 151 delete data; |
| 153 } | 152 } |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 GURL url; | 431 GURL url; |
| 433 string16 title; | 432 string16 title; |
| 434 if (!gtk_dnd_util::ExtractNetscapeURL(selection_data, &url, &title)) | 433 if (!gtk_dnd_util::ExtractNetscapeURL(selection_data, &url, &title)) |
| 435 return false; | 434 return false; |
| 436 | 435 |
| 437 model->AddURL(parent, idx, title, url); | 436 model->AddURL(parent, idx, title, url); |
| 438 return true; | 437 return true; |
| 439 } | 438 } |
| 440 | 439 |
| 441 } // namespace bookmark_utils | 440 } // namespace bookmark_utils |
| OLD | NEW |