OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/gfx/gtk_util.h" | 8 #include "base/gfx/gtk_util.h" |
9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END); | 122 gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END); |
123 | 123 |
124 GtkWidget* box = gtk_hbox_new(FALSE, kBarButtonPadding); | 124 GtkWidget* box = gtk_hbox_new(FALSE, kBarButtonPadding); |
125 gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0); | 125 gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0); |
126 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0); | 126 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0); |
127 gtk_container_add(GTK_CONTAINER(button), box); | 127 gtk_container_add(GTK_CONTAINER(button), box); |
128 | 128 |
129 SetButtonTextColors(label); | 129 SetButtonTextColors(label); |
130 g_object_set_data(G_OBJECT(button), bookmark_utils::kBookmarkNode, | 130 g_object_set_data(G_OBJECT(button), bookmark_utils::kBookmarkNode, |
131 AsVoid(node)); | 131 AsVoid(node)); |
| 132 |
| 133 gtk_widget_show_all(button); |
132 } | 134 } |
133 | 135 |
134 std::string BuildTooltipFor(const BookmarkNode* node) { | 136 std::string BuildTooltipFor(const BookmarkNode* node) { |
135 // TODO(erg): Actually build the tooltip. For now, we punt and just return | 137 // TODO(erg): Actually build the tooltip. For now, we punt and just return |
136 // the URL. | 138 // the URL. |
137 return node->GetURL().possibly_invalid_spec(); | 139 return node->GetURL().possibly_invalid_spec(); |
138 } | 140 } |
139 | 141 |
140 const BookmarkNode* BookmarkNodeForWidget(GtkWidget* widget) { | 142 const BookmarkNode* BookmarkNodeForWidget(GtkWidget* widget) { |
141 return reinterpret_cast<const BookmarkNode*>( | 143 return reinterpret_cast<const BookmarkNode*>( |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 default: { | 212 default: { |
211 DLOG(ERROR) << "Unsupported drag received type: " << target_type; | 213 DLOG(ERROR) << "Unsupported drag received type: " << target_type; |
212 } | 214 } |
213 } | 215 } |
214 } | 216 } |
215 | 217 |
216 return std::vector<const BookmarkNode*>(); | 218 return std::vector<const BookmarkNode*>(); |
217 } | 219 } |
218 | 220 |
219 } // namespace bookmark_utils | 221 } // namespace bookmark_utils |
OLD | NEW |