| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/infobars/infobar_text_button.h" | 5 #include "chrome/browser/ui/views/infobars/infobar_text_button.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | |
| 9 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/views/infobars/infobar_button_border.h" | 9 #include "chrome/browser/ui/views/infobars/infobar_button_border.h" |
| 10 #include "ui/base/resource/resource_bundle.h" |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 InfoBarTextButton* InfoBarTextButton::Create(views::ButtonListener* listener, | 13 InfoBarTextButton* InfoBarTextButton::Create(views::ButtonListener* listener, |
| 14 const string16& text) { | 14 const string16& text) { |
| 15 return new InfoBarTextButton(listener, text); | 15 return new InfoBarTextButton(listener, text); |
| 16 } | 16 } |
| 17 | 17 |
| 18 // static | 18 // static |
| 19 InfoBarTextButton* InfoBarTextButton::CreateWithMessageID( | 19 InfoBarTextButton* InfoBarTextButton::CreateWithMessageID( |
| 20 views::ButtonListener* listener, int message_id) { | 20 views::ButtonListener* listener, int message_id) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 48 SetEnabledColor(SK_ColorBLACK); | 48 SetEnabledColor(SK_ColorBLACK); |
| 49 SetHighlightColor(SK_ColorBLACK); | 49 SetHighlightColor(SK_ColorBLACK); |
| 50 SetHoverColor(SK_ColorBLACK); | 50 SetHoverColor(SK_ColorBLACK); |
| 51 // Set font then text, then size button to fit text. | 51 // Set font then text, then size button to fit text. |
| 52 SetFont( | 52 SetFont( |
| 53 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont)); | 53 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont)); |
| 54 SetText(UTF16ToWideHack(text)); | 54 SetText(UTF16ToWideHack(text)); |
| 55 ClearMaxTextSize(); | 55 ClearMaxTextSize(); |
| 56 SizeToPreferredSize(); | 56 SizeToPreferredSize(); |
| 57 } | 57 } |
| OLD | NEW |