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

Side by Side Diff: chrome/browser/ui/views/avatar_menu_bubble_view.cc

Issue 111023004: Add GetMinimumSize() for Labels and ensure it's zero for empty Links. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years 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 | ui/views/controls/label.h » ('j') | 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/views/avatar_menu_bubble_view.h" 5 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 sync_state_label_->SetFont(rb->GetFont(ui::ResourceBundle::SmallFont)); 283 sync_state_label_->SetFont(rb->GetFont(ui::ResourceBundle::SmallFont));
284 sync_state_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 284 sync_state_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
285 sync_state_label_->SetEnabled(false); 285 sync_state_label_->SetEnabled(false);
286 AddChildView(sync_state_label_); 286 AddChildView(sync_state_label_);
287 287
288 // Add an edit profile link. 288 // Add an edit profile link.
289 edit_link_ = new EditProfileLink( 289 edit_link_ = new EditProfileLink(
290 l10n_util::GetStringUTF16(IDS_PROFILES_EDIT_PROFILE_LINK), this); 290 l10n_util::GetStringUTF16(IDS_PROFILES_EDIT_PROFILE_LINK), this);
291 edit_link_->set_listener(parent); 291 edit_link_->set_listener(parent);
292 edit_link_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 292 edit_link_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
293 edit_link_->SetHasFocusBorder(true);
294 AddChildView(edit_link_); 293 AddChildView(edit_link_);
295 294
296 OnHighlightStateChanged(); 295 OnHighlightStateChanged();
297 } 296 }
298 297
299 gfx::Size ProfileItemView::GetPreferredSize() { 298 gfx::Size ProfileItemView::GetPreferredSize() {
300 int text_width = std::max(name_label_->GetPreferredSize().width(), 299 int text_width = std::max(name_label_->GetPreferredSize().width(),
301 sync_state_label_->GetPreferredSize().width()); 300 sync_state_label_->GetPreferredSize().width());
302 text_width = std::max(edit_link_->GetPreferredSize().width(), text_width); 301 text_width = std::max(edit_link_->GetPreferredSize().width(), text_width);
303 text_width = std::min(kMaxItemTextWidth, text_width); 302 text_width = std::min(kMaxItemTextWidth, text_width);
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 Layout(); 804 Layout();
806 if (GetBubbleFrameView()) 805 if (GetBubbleFrameView())
807 SizeToContents(); 806 SizeToContents();
808 } 807 }
809 808
810 void AvatarMenuBubbleView::SetBackgroundColors() { 809 void AvatarMenuBubbleView::SetBackgroundColors() {
811 for (size_t i = 0; i < item_views_.size(); ++i) { 810 for (size_t i = 0; i < item_views_.size(); ++i) {
812 item_views_[i]->OnHighlightStateChanged(); 811 item_views_[i]->OnHighlightStateChanged();
813 } 812 }
814 } 813 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698