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

Side by Side Diff: ui/views/controls/button/label_button.cc

Issue 2143473002: [ash-md] Updates window title if it is changed after entering overview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates LabelButton label size when text is changed Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/controls/button/label_button_unittest.cc » ('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 "ui/views/controls/button/label_button.h" 5 #include "ui/views/controls/button/label_button.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 } 534 }
535 535
536 void LabelButton::SetTextInternal(const base::string16& text) { 536 void LabelButton::SetTextInternal(const base::string16& text) {
537 SetAccessibleName(text); 537 SetAccessibleName(text);
538 label_->SetText(text); 538 label_->SetText(text);
539 } 539 }
540 540
541 void LabelButton::ChildPreferredSizeChanged(View* child) { 541 void LabelButton::ChildPreferredSizeChanged(View* child) {
542 ResetCachedPreferredSize(); 542 ResetCachedPreferredSize();
543 PreferredSizeChanged(); 543 PreferredSizeChanged();
544 Layout();
sadrul 2016/07/12 16:57:42 Interesting. Looks like PreferredSizeChanged() inv
varkha 2016/07/12 19:58:44 Discussed this offline. sadrul@ thought we could h
544 } 545 }
545 546
546 ui::NativeTheme::Part LabelButton::GetThemePart() const { 547 ui::NativeTheme::Part LabelButton::GetThemePart() const {
547 return ui::NativeTheme::kPushButton; 548 return ui::NativeTheme::kPushButton;
548 } 549 }
549 550
550 gfx::Rect LabelButton::GetThemePaintRect() const { 551 gfx::Rect LabelButton::GetThemePaintRect() const {
551 return GetLocalBounds(); 552 return GetLocalBounds();
552 } 553 }
553 554
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 void LabelButton::ResetLabelEnabledColor() { 589 void LabelButton::ResetLabelEnabledColor() {
589 const SkColor color = 590 const SkColor color =
590 explicitly_set_colors_[state()] 591 explicitly_set_colors_[state()]
591 ? button_state_colors_[state()] 592 ? button_state_colors_[state()]
592 : PlatformStyle::TextColorForButton(button_state_colors_, *this); 593 : PlatformStyle::TextColorForButton(button_state_colors_, *this);
593 if (state() != STATE_DISABLED && label_->enabled_color() != color) 594 if (state() != STATE_DISABLED && label_->enabled_color() != color)
594 label_->SetEnabledColor(color); 595 label_->SetEnabledColor(color);
595 } 596 }
596 597
597 } // namespace views 598 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/button/label_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698