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

Unified Diff: chrome/browser/ui/gtk/profile_menu_button.cc

Issue 7321011: Multi-Profiles: Add delete profile command (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove debug code Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/gtk/profile_menu_button.cc
diff --git a/chrome/browser/ui/gtk/profile_menu_button.cc b/chrome/browser/ui/gtk/profile_menu_button.cc
index 9b7db3f5d9b65959fd53cead16459364ef0b4d90..e020546c7c840ad6851ff40920b815d7e7175476 100644
--- a/chrome/browser/ui/gtk/profile_menu_button.cc
+++ b/chrome/browser/ui/gtk/profile_menu_button.cc
@@ -15,8 +15,8 @@
// Maximum width for name string in pixels.
const int kMaxTextWidth = 200;
-ProfileMenuButton::ProfileMenuButton() {
- profile_menu_model_.reset(new ProfileMenuModel);
+ProfileMenuButton::ProfileMenuButton(Profile* profile) : profile_(profile) {
+ profile_menu_model_.reset(new ProfileMenuModel(profile_));
menu_.reset(new MenuGtk(NULL, profile_menu_model_.get()));
widget_.Own(gtk_button_new());
@@ -28,9 +28,9 @@ ProfileMenuButton::ProfileMenuButton() {
ProfileMenuButton::~ProfileMenuButton() {}
-void ProfileMenuButton::UpdateText(Profile* profile) {
+void ProfileMenuButton::UpdateText() {
string16 text = UTF8ToUTF16(
- profile->GetPrefs()->GetString(prefs::kGoogleServicesUsername));
+ profile_->GetPrefs()->GetString(prefs::kGoogleServicesUsername));
string16 elided_text = ui::ElideText(text, gfx::Font(), kMaxTextWidth, false);
gtk_button_set_label(
GTK_BUTTON(widget_.get()), UTF16ToUTF8(elided_text).c_str());

Powered by Google App Engine
This is Rietveld 408576698