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

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

Issue 11262002: Merge TextButton and LabelButton border images util structs, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename BorderImages and const image id arrays, etc. Created 8 years, 1 month 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
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 "base/logging.h" 7 #include "base/logging.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "ui/base/animation/throb_animation.h" 9 #include "ui/base/animation/throb_animation.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 16 matching lines...) Expand all
27 static const int kHoverAnimationDurationMs = 170; 27 static const int kHoverAnimationDurationMs = 170;
28 28
29 } // namespace 29 } // namespace
30 30
31 LabelButton::LabelButton(ButtonListener* listener, const string16& text) 31 LabelButton::LabelButton(ButtonListener* listener, const string16& text)
32 : CustomButton(listener), 32 : CustomButton(listener),
33 image_(new ImageView()), 33 image_(new ImageView()),
34 label_(new Label(text)), 34 label_(new Label(text)),
35 default_button_(false), 35 default_button_(false),
36 native_theme_(false) { 36 native_theme_(false) {
37 set_border(new LabelButtonBorder(this)); 37 set_border(new LabelButtonBorder());
38 // Inset the button focus rect from the actual border; roughly match Windows. 38 // Inset the button focus rect from the actual border; roughly match Windows.
39 set_focus_border(FocusBorder::CreateDashedFocusBorder(3, 3, 3, 3)); 39 set_focus_border(FocusBorder::CreateDashedFocusBorder(3, 3, 3, 3));
40 SetAnimationDuration(kHoverAnimationDurationMs); 40 SetAnimationDuration(kHoverAnimationDurationMs);
41 41
42 AddChildView(image_); 42 AddChildView(image_);
43 image_->set_interactive(false); 43 image_->set_interactive(false);
44 44
45 AddChildView(label_); 45 AddChildView(label_);
46 label_->SetAutoColorReadabilityEnabled(false); 46 label_->SetAutoColorReadabilityEnabled(false);
47 label_->SetHorizontalAlignment(Label::ALIGN_LEFT); 47 label_->SetHorizontalAlignment(Label::ALIGN_LEFT);
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 params->button.indeterminate = false; 253 params->button.indeterminate = false;
254 params->button.is_default = default_button(); 254 params->button.is_default = default_button();
255 params->button.is_focused = HasFocus() && IsAccessibilityFocusable(); 255 params->button.is_focused = HasFocus() && IsAccessibilityFocusable();
256 params->button.has_border = native_theme(); 256 params->button.has_border = native_theme();
257 params->button.classic_state = 0; 257 params->button.classic_state = 0;
258 params->button.background_color = ui::NativeTheme::instance()->GetSystemColor( 258 params->button.background_color = ui::NativeTheme::instance()->GetSystemColor(
259 ui::NativeTheme::kColorId_TextButtonBackgroundColor); 259 ui::NativeTheme::kColorId_TextButtonBackgroundColor);
260 } 260 }
261 261
262 } // namespace views 262 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698