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

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

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 years, 11 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 | « ui/views/controls/button/label_button.cc ('k') | ui/views/controls/combobox/combobox.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/text_button.h" 5 #include "ui/views/controls/button/text_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 // TextButton ----------------------------------------------------------------- 596 // TextButton -----------------------------------------------------------------
597 597
598 TextButton::TextButton(ButtonListener* listener, const base::string16& text) 598 TextButton::TextButton(ButtonListener* listener, const base::string16& text)
599 : TextButtonBase(listener, text), 599 : TextButtonBase(listener, text),
600 icon_placement_(ICON_ON_LEFT), 600 icon_placement_(ICON_ON_LEFT),
601 has_hover_icon_(false), 601 has_hover_icon_(false),
602 has_pushed_icon_(false), 602 has_pushed_icon_(false),
603 icon_text_spacing_(kDefaultIconTextSpacing), 603 icon_text_spacing_(kDefaultIconTextSpacing),
604 ignore_minimum_size_(true), 604 ignore_minimum_size_(true),
605 full_justification_(false) { 605 full_justification_(false) {
606 set_border(new TextButtonDefaultBorder); 606 SetBorder(scoped_ptr<Border>(new TextButtonDefaultBorder));
607 SetFocusPainter(Painter::CreateDashedFocusPainterWithInsets( 607 SetFocusPainter(Painter::CreateDashedFocusPainterWithInsets(
608 gfx::Insets(kFocusRectInset, kFocusRectInset, 608 gfx::Insets(kFocusRectInset, kFocusRectInset,
609 kFocusRectInset, kFocusRectInset))); 609 kFocusRectInset, kFocusRectInset)));
610 } 610 }
611 611
612 TextButton::~TextButton() { 612 TextButton::~TextButton() {
613 } 613 }
614 614
615 void TextButton::SetIcon(const gfx::ImageSkia& icon) { 615 void TextButton::SetIcon(const gfx::ImageSkia& icon) {
616 icon_ = icon; 616 icon_ = icon;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 if (show_multiple_icon_states_) { 748 if (show_multiple_icon_states_) {
749 if (has_hover_icon_ && (state() == STATE_HOVERED)) 749 if (has_hover_icon_ && (state() == STATE_HOVERED))
750 return icon_hover_; 750 return icon_hover_;
751 if (has_pushed_icon_ && (state() == STATE_PRESSED)) 751 if (has_pushed_icon_ && (state() == STATE_PRESSED))
752 return icon_pushed_; 752 return icon_pushed_;
753 } 753 }
754 return icon_; 754 return icon_;
755 } 755 }
756 756
757 } // namespace views 757 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698