Commit aa25397e authored by tfarina@chromium.org's avatar tfarina@chromium.org

views: Remove NativeTextButton::SetLabel() and replace all call sites with SetText().

Note: This was a TODO added by rogerta@chromium.org

BUG=None
TEST=None

R=sky@chromium.org

Review URL: http://codereview.chromium.org/7717028

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98259 0039d316-1c4b-4281-b951-d872f2087c98
parent 3469256c
...@@ -382,15 +382,15 @@ void EulaView::UpdateLocalizedStrings() { ...@@ -382,15 +382,15 @@ void EulaView::UpdateLocalizedStrings() {
} }
// Load other labels from resources. // Load other labels from resources.
usage_statistics_checkbox_->SetLabel( usage_statistics_checkbox_->SetText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_EULA_CHECKBOX_ENABLE_LOGGING))); UTF16ToWide(l10n_util::GetStringUTF16(IDS_EULA_CHECKBOX_ENABLE_LOGGING)));
learn_more_link_->SetText( learn_more_link_->SetText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_LEARN_MORE))); UTF16ToWide(l10n_util::GetStringUTF16(IDS_LEARN_MORE)));
system_security_settings_link_->SetText( system_security_settings_link_->SetText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_EULA_SYSTEM_SECURITY_SETTING))); UTF16ToWide(l10n_util::GetStringUTF16(IDS_EULA_SYSTEM_SECURITY_SETTING)));
continue_button_->SetLabel(UTF16ToWide( continue_button_->SetText(UTF16ToWide(
l10n_util::GetStringUTF16(IDS_EULA_ACCEPT_AND_CONTINUE_BUTTON))); l10n_util::GetStringUTF16(IDS_EULA_ACCEPT_AND_CONTINUE_BUTTON)));
back_button_->SetLabel( back_button_->SetText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_EULA_BACK_BUTTON))); UTF16ToWide(l10n_util::GetStringUTF16(IDS_EULA_BACK_BUTTON)));
} }
......
...@@ -300,7 +300,7 @@ void NewUserView::UpdateLocalizedStringsAndFonts() { ...@@ -300,7 +300,7 @@ void NewUserView::UpdateLocalizedStringsAndFonts() {
SetAndCorrectTextfieldFont(password_field_, base_font); SetAndCorrectTextfieldFont(password_field_, base_font);
password_field_->set_text_to_display_when_empty( password_field_->set_text_to_display_when_empty(
l10n_util::GetStringUTF16(IDS_LOGIN_PASSWORD)); l10n_util::GetStringUTF16(IDS_LOGIN_PASSWORD));
sign_in_button_->SetLabel(UTF16ToWide( sign_in_button_->SetText(UTF16ToWide(
l10n_util::GetStringUTF16(IDS_LOGIN_BUTTON))); l10n_util::GetStringUTF16(IDS_LOGIN_BUTTON)));
if (need_guest_link_) { if (need_guest_link_) {
guest_link_->SetFont(base_font); guest_link_->SetFont(base_font);
......
...@@ -286,7 +286,7 @@ void FirstRunSearchEngineView::OnTemplateURLServiceChanged() { ...@@ -286,7 +286,7 @@ void FirstRunSearchEngineView::OnTemplateURLServiceChanged() {
for (it = search_engine_choices_.begin(); for (it = search_engine_choices_.begin();
it != search_engine_choices_.end(); it != search_engine_choices_.end();
it++) { it++) {
(*it)->SetLabel((*it)->GetSearchEngine()->short_name()); (*it)->SetText((*it)->GetSearchEngine()->short_name());
} }
} }
......
...@@ -30,10 +30,6 @@ class VIEWS_EXPORT Checkbox : public TextButtonBase { ...@@ -30,10 +30,6 @@ class VIEWS_EXPORT Checkbox : public TextButtonBase {
virtual void SetChecked(bool checked); virtual void SetChecked(bool checked);
bool checked() const { return checked_; } bool checked() const { return checked_; }
void SetLabel(const std::wstring& label) {
SetText(label);
}
protected: protected:
// Overridden from View: // Overridden from View:
virtual gfx::Size GetPreferredSize() OVERRIDE; virtual gfx::Size GetPreferredSize() OVERRIDE;
......
...@@ -407,13 +407,6 @@ class VIEWS_EXPORT NativeTextButton : public TextButton { ...@@ -407,13 +407,6 @@ class VIEWS_EXPORT NativeTextButton : public TextButton {
NativeTextButton(ButtonListener* listener); NativeTextButton(ButtonListener* listener);
NativeTextButton(ButtonListener* listener, const std::wstring& text); NativeTextButton(ButtonListener* listener, const std::wstring& text);
// Sets/Gets the text to be used as the button's label.
// TODO: Remove this function and replace all call sites with SetText().
void SetLabel(const std::wstring& label) {
SetText(label);
}
std::wstring label() const { return text(); }
// Overridden from TextButton: // Overridden from TextButton:
virtual gfx::Size GetMinimumSize() OVERRIDE; virtual gfx::Size GetMinimumSize() OVERRIDE;
......
...@@ -77,7 +77,7 @@ void MessageBoxView::SetCheckBoxLabel(const std::wstring& label) { ...@@ -77,7 +77,7 @@ void MessageBoxView::SetCheckBoxLabel(const std::wstring& label) {
if (!checkbox_) if (!checkbox_)
checkbox_ = new Checkbox(label); checkbox_ = new Checkbox(label);
else else
checkbox_->SetLabel(label); checkbox_->SetText(label);
ResetLayoutManager(); ResetLayoutManager();
} }
......
...@@ -47,7 +47,7 @@ void UpdateButtonHelper(NativeTextButton* button_view, ...@@ -47,7 +47,7 @@ void UpdateButtonHelper(NativeTextButton* button_view,
MessageBoxFlags::DialogButton button) { MessageBoxFlags::DialogButton button) {
std::wstring label = delegate->GetDialogButtonLabel(button); std::wstring label = delegate->GetDialogButtonLabel(button);
if (!label.empty()) if (!label.empty())
button_view->SetLabel(label); button_view->SetText(label);
button_view->SetEnabled(delegate->IsDialogButtonEnabled(button)); button_view->SetEnabled(delegate->IsDialogButtonEnabled(button));
button_view->SetVisible(delegate->IsDialogButtonVisible(button)); button_view->SetVisible(delegate->IsDialogButtonVisible(button));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment