summaryrefslogtreecommitdiffstats
path: root/views/controls/button
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls/button')
-rw-r--r--views/controls/button/checkbox.cc7
-rw-r--r--views/controls/button/text_button.cc11
-rw-r--r--views/controls/button/text_button.h5
3 files changed, 12 insertions, 11 deletions
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc
index b60e802..6eb683d 100644
--- a/views/controls/button/checkbox.cc
+++ b/views/controls/button/checkbox.cc
@@ -5,22 +5,23 @@
#include "views/controls/button/checkbox.h"
#include "base/logging.h"
+#include "base/utf_string_conversions.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/gfx/canvas.h"
#include "views/controls/label.h"
namespace views {
-const int kCheckboxLabelSpacing = 4;
-
// static
const char Checkbox::kViewClassName[] = "views/Checkbox";
+static const int kCheckboxLabelSpacing = 4;
+
////////////////////////////////////////////////////////////////////////////////
// Checkbox, public:
Checkbox::Checkbox(const string16& label)
- : TextButtonBase(NULL, label),
+ : TextButtonBase(NULL, UTF16ToWideHack(label)),
checked_(false) {
set_border(new TextButtonNativeThemeBorder(this));
set_focusable(true);
diff --git a/views/controls/button/text_button.cc b/views/controls/button/text_button.cc
index 1d56f1d..58c0030 100644
--- a/views/controls/button/text_button.cc
+++ b/views/controls/button/text_button.cc
@@ -264,7 +264,8 @@ void TextButtonNativeThemeBorder::GetInsets(gfx::Insets* insets) const {
////////////////////////////////////////////////////////////////////////////////
// TextButtonBase, public:
-TextButtonBase::TextButtonBase(ButtonListener* listener, const string16& text)
+TextButtonBase::TextButtonBase(ButtonListener* listener,
+ const std::wstring& text)
: CustomButton(listener),
alignment_(ALIGN_LEFT),
font_(ResourceBundle::GetSharedInstance().GetFont(
@@ -303,9 +304,9 @@ void TextButtonBase::SetIsDefault(bool is_default) {
SchedulePaint();
}
-void TextButtonBase::SetText(const string16& text) {
- text_ = text;
- SetAccessibleName(text);
+void TextButtonBase::SetText(const std::wstring& text) {
+ text_ = WideToUTF16Hack(text);
+ SetAccessibleName(WideToUTF16Hack(text));
UpdateTextSize();
}
@@ -652,7 +653,7 @@ gfx::NativeTheme::State TextButtonBase::GetForegroundThemeState(
TextButton::TextButton(ButtonListener* listener,
const std::wstring& text)
- : TextButtonBase(listener, WideToUTF16Hack(text)),
+ : TextButtonBase(listener, text),
icon_placement_(ICON_ON_LEFT),
has_hover_icon_(false),
has_pushed_icon_(false),
diff --git a/views/controls/button/text_button.h b/views/controls/button/text_button.h
index 031b59a..fedd114 100644
--- a/views/controls/button/text_button.h
+++ b/views/controls/button/text_button.h
@@ -8,7 +8,6 @@
#include <string>
-#include "base/string16.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/font.h"
@@ -140,7 +139,7 @@ class VIEWS_EXPORT TextButtonBase : public CustomButton,
// Call SetText once per string in your set of possible values at button
// creation time, so that it can contain the largest of them and avoid
// resizing the button when the text changes.
- virtual void SetText(const string16& text);
+ virtual void SetText(const std::wstring& text);
const string16& text() const { return text_; }
enum TextAlignment {
@@ -216,7 +215,7 @@ class VIEWS_EXPORT TextButtonBase : public CustomButton,
virtual std::string GetClassName() const OVERRIDE;
protected:
- TextButtonBase(ButtonListener* listener, const string16& text);
+ TextButtonBase(ButtonListener* listener, const std::wstring& text);
// Called when enabled or disabled state changes, or the colors for those
// states change.