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

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

Issue 10828199: [gtk] Use correct string (user name) in avatar bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/avatar_menu_item_gtk.h" 5 #include "chrome/browser/ui/gtk/avatar_menu_item_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 GtkWidget* name_label = NULL; 229 GtkWidget* name_label = NULL;
230 string16 elided_name = ui::ElideText(item_.name, 230 string16 elided_name = ui::ElideText(item_.name,
231 gfx::Font(), 231 gfx::Font(),
232 kUserNameMaxWidth, 232 kUserNameMaxWidth,
233 ui::ELIDE_AT_END); 233 ui::ELIDE_AT_END);
234 234
235 name_label = theme_service->BuildLabel(UTF16ToUTF8(elided_name), 235 name_label = theme_service->BuildLabel(UTF16ToUTF8(elided_name),
236 ui::kGdkBlack); 236 ui::kGdkBlack);
237 if (item_.active) { 237 if (item_.active) {
238 char* markup = g_markup_printf_escaped( 238 char* markup = g_markup_printf_escaped(
239 "<span weight='bold'>%s</span>", UTF16ToUTF8(item_.sync_state).c_str()); 239 "<span weight='bold'>%s</span>", UTF16ToUTF8(elided_name).c_str());
240 gtk_label_set_markup(GTK_LABEL(name_label), markup); 240 gtk_label_set_markup(GTK_LABEL(name_label), markup);
241 } 241 }
242 242
243 gtk_misc_set_alignment(GTK_MISC(name_label), 0, 0); 243 gtk_misc_set_alignment(GTK_MISC(name_label), 0, 0);
244 gtk_box_pack_start(GTK_BOX(item_vbox), name_label, TRUE, TRUE, 0); 244 gtk_box_pack_start(GTK_BOX(item_vbox), name_label, TRUE, TRUE, 0);
245 245
246 // The sync status label. 246 // The sync status label.
247 status_label_ = theme_service_->BuildLabel(std::string(), ui::kGdkBlack); 247 status_label_ = theme_service_->BuildLabel(std::string(), ui::kGdkBlack);
248 char* markup = g_markup_printf_escaped( 248 char* markup = g_markup_printf_escaped(
249 "<span size='small'>%s</span>", UTF16ToUTF8(item_.sync_state).c_str()); 249 "<span size='small'>%s</span>", UTF16ToUTF8(item_.sync_state).c_str());
(...skipping 29 matching lines...) Expand all
279 279
280 GtkSizeGroup* size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); 280 GtkSizeGroup* size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
281 gtk_size_group_add_widget(size_group, status_label_); 281 gtk_size_group_add_widget(size_group, status_label_);
282 gtk_size_group_add_widget(size_group, link_alignment_); 282 gtk_size_group_add_widget(size_group, link_alignment_);
283 g_object_unref(size_group); 283 g_object_unref(size_group);
284 } 284 }
285 285
286 gtk_box_pack_start(GTK_BOX(item_hbox), item_vbox, TRUE, TRUE, 0); 286 gtk_box_pack_start(GTK_BOX(item_hbox), item_vbox, TRUE, TRUE, 0);
287 gtk_container_add(GTK_CONTAINER(widget_.get()), item_hbox); 287 gtk_container_add(GTK_CONTAINER(widget_.get()), item_hbox);
288 } 288 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698