summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/chromeos/external_protocol_dialog.cc10
-rw-r--r--chrome/browser/ui/views/external_protocol_dialog.cc13
-rw-r--r--chrome/browser/ui/views/js_modal_dialog_views.cc8
-rw-r--r--chrome/browser/ui/views/repost_form_warning_view.cc4
-rw-r--r--chrome/browser/ui/views/restart_message_box.cc5
-rw-r--r--chrome/browser/ui/views/simple_message_box_views.cc7
-rw-r--r--chrome/browser/ui/views/update_recommended_message_box.cc5
-rw-r--r--chrome/browser/ui/views/user_data_dir_dialog.cc8
-rw-r--r--views/controls/message_box_view.cc24
-rw-r--r--views/controls/message_box_view.h12
-rw-r--r--views/examples/message_box_example.cc8
11 files changed, 52 insertions, 52 deletions
diff --git a/chrome/browser/chromeos/external_protocol_dialog.cc b/chrome/browser/chromeos/external_protocol_dialog.cc
index 6a005503..560e720 100644
--- a/chrome/browser/chromeos/external_protocol_dialog.cc
+++ b/chrome/browser/chromeos/external_protocol_dialog.cc
@@ -102,18 +102,18 @@ ExternalProtocolDialog::ExternalProtocolDialog(TabContents* tab_contents,
ui::ElideString(ASCIIToUTF16(url.possibly_invalid_spec()),
kMaxUrlWithoutSchemeSize, &elided_url_without_scheme);
- std::wstring message_text = UTF16ToWide(l10n_util::GetStringFUTF16(
+ string16 message_text = l10n_util::GetStringFUTF16(
IDS_EXTERNAL_PROTOCOL_INFORMATION,
ASCIIToUTF16(url.scheme() + ":"),
- elided_url_without_scheme) + ASCIIToUTF16("\n\n"));
+ elided_url_without_scheme) + ASCIIToUTF16("\n\n");
message_box_view_ = new views::MessageBoxView(
ui::MessageBoxFlags::kIsConfirmMessageBox,
message_text,
- std::wstring(),
+ string16(),
kMessageWidth);
- message_box_view_->SetCheckBoxLabel(UTF16ToWide(
- l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT)));
+ message_box_view_->SetCheckBoxLabel(
+ l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT));
gfx::NativeWindow parent_window;
if (tab_contents) {
diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc
index a0a78cf..e2bae68 100644
--- a/chrome/browser/ui/views/external_protocol_dialog.cc
+++ b/chrome/browser/ui/views/external_protocol_dialog.cc
@@ -135,22 +135,21 @@ ExternalProtocolDialog::ExternalProtocolDialog(TabContents* tab_contents,
kMaxUrlWithoutSchemeSize, &elided_url_without_scheme);
ui::ElideString(WideToUTF16Hack(command), kMaxCommandSize, &elided_command);
- std::wstring message_text = UTF16ToWide(l10n_util::GetStringFUTF16(
+ string16 message_text = l10n_util::GetStringFUTF16(
IDS_EXTERNAL_PROTOCOL_INFORMATION,
ASCIIToUTF16(url.scheme() + ":"),
- elided_url_without_scheme) + ASCIIToUTF16("\n\n"));
+ elided_url_without_scheme) + ASCIIToUTF16("\n\n");
- message_text += UTF16ToWide(l10n_util::GetStringFUTF16(
+ message_text += l10n_util::GetStringFUTF16(
IDS_EXTERNAL_PROTOCOL_APPLICATION_TO_LAUNCH,
- elided_command) + ASCIIToUTF16("\n\n"));
+ elided_command) + ASCIIToUTF16("\n\n");
- message_text +=
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_WARNING));
+ message_text += l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_WARNING);
message_box_view_ = new views::MessageBoxView(
ui::MessageBoxFlags::kIsConfirmMessageBox,
message_text,
- std::wstring(),
+ string16(),
kMessageWidth);
message_box_view_->SetCheckBoxLabel(
l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT));
diff --git a/chrome/browser/ui/views/js_modal_dialog_views.cc b/chrome/browser/ui/views/js_modal_dialog_views.cc
index 9124b80..24f7bd7 100644
--- a/chrome/browser/ui/views/js_modal_dialog_views.cc
+++ b/chrome/browser/ui/views/js_modal_dialog_views.cc
@@ -23,15 +23,15 @@ JSModalDialogViews::JSModalDialogViews(
: parent_(parent),
message_box_view_(new views::MessageBoxView(
parent->dialog_flags() | ui::MessageBoxFlags::kAutoDetectAlignment,
- UTF16ToWideHack(parent->message_text()),
- UTF16ToWideHack(parent->default_prompt_text()))) {
+ parent->message_text(),
+ parent->default_prompt_text())) {
DCHECK(message_box_view_);
message_box_view_->AddAccelerator(
views::Accelerator(ui::VKEY_C, false, true, false));
if (parent->display_suppress_checkbox()) {
- message_box_view_->SetCheckBoxLabel(UTF16ToWide(
- l10n_util::GetStringUTF16(IDS_JAVASCRIPT_MESSAGEBOX_SUPPRESS_OPTION)));
+ message_box_view_->SetCheckBoxLabel(
+ l10n_util::GetStringUTF16(IDS_JAVASCRIPT_MESSAGEBOX_SUPPRESS_OPTION));
}
}
diff --git a/chrome/browser/ui/views/repost_form_warning_view.cc b/chrome/browser/ui/views/repost_form_warning_view.cc
index 5872184..0dec119 100644
--- a/chrome/browser/ui/views/repost_form_warning_view.cc
+++ b/chrome/browser/ui/views/repost_form_warning_view.cc
@@ -37,8 +37,8 @@ RepostFormWarningView::RepostFormWarningView(
message_box_view_(NULL) {
message_box_view_ = new views::MessageBoxView(
ui::MessageBoxFlags::kIsConfirmMessageBox,
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING)),
- std::wstring());
+ l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING),
+ string16());
TabContentsWrapper* wrapper =
TabContentsWrapper::GetCurrentWrapperForContents(tab_contents);
controller_->set_window(new ConstrainedWindowViews(wrapper, this));
diff --git a/chrome/browser/ui/views/restart_message_box.cc b/chrome/browser/ui/views/restart_message_box.cc
index 09070f9..807dec0 100644
--- a/chrome/browser/ui/views/restart_message_box.cc
+++ b/chrome/browser/ui/views/restart_message_box.cc
@@ -64,9 +64,8 @@ RestartMessageBox::RestartMessageBox(gfx::NativeWindow parent_window) {
message_box_view_ = new views::MessageBoxView(
ui::MessageBoxFlags::kFlagHasMessage |
ui::MessageBoxFlags::kFlagHasOKButton,
- UTF16ToWide(
- l10n_util::GetStringUTF16(IDS_OPTIONS_RELAUNCH_REQUIRED)).c_str(),
- std::wstring(),
+ l10n_util::GetStringUTF16(IDS_OPTIONS_RELAUNCH_REQUIRED),
+ string16(),
kDialogWidth);
views::Widget::CreateWindowWithParent(this, parent_window)->Show();
}
diff --git a/chrome/browser/ui/views/simple_message_box_views.cc b/chrome/browser/ui/views/simple_message_box_views.cc
index f49f688..298412f 100644
--- a/chrome/browser/ui/views/simple_message_box_views.cc
+++ b/chrome/browser/ui/views/simple_message_box_views.cc
@@ -136,10 +136,9 @@ SimpleMessageBoxViews::SimpleMessageBoxViews(gfx::NativeWindow parent_window,
: dialog_flags_(dialog_flags),
disposition_(DISPOSITION_UNKNOWN) {
message_box_title_ = title;
- message_box_view_ = new views::MessageBoxView(
- dialog_flags,
- UTF16ToWide(message),
- std::wstring());
+ message_box_view_ = new views::MessageBoxView(dialog_flags,
+ message,
+ string16());
browser::CreateViewsWindow(parent_window, this)->Show();
// Add reference to be released in DeleteDelegate().
diff --git a/chrome/browser/ui/views/update_recommended_message_box.cc b/chrome/browser/ui/views/update_recommended_message_box.cc
index e41f1b0..1d30247 100644
--- a/chrome/browser/ui/views/update_recommended_message_box.cc
+++ b/chrome/browser/ui/views/update_recommended_message_box.cc
@@ -101,9 +101,8 @@ UpdateRecommendedMessageBox::UpdateRecommendedMessageBox(
message_box_view_ = new views::MessageBoxView(
ui::MessageBoxFlags::kFlagHasMessage |
ui::MessageBoxFlags::kFlagHasOKButton,
- UTF16ToWideHack(l10n_util::GetStringFUTF16(IDS_UPDATE_RECOMMENDED,
- product_name)),
- std::wstring(),
+ l10n_util::GetStringFUTF16(IDS_UPDATE_RECOMMENDED, product_name),
+ string16(),
kDialogWidth);
browser::CreateViewsWindow(parent_window, this)->Show();
}
diff --git a/chrome/browser/ui/views/user_data_dir_dialog.cc b/chrome/browser/ui/views/user_data_dir_dialog.cc
index 2996de9..a700958 100644
--- a/chrome/browser/ui/views/user_data_dir_dialog.cc
+++ b/chrome/browser/ui/views/user_data_dir_dialog.cc
@@ -25,13 +25,15 @@ UserDataDirDialog::UserDataDirDialog(const FilePath& user_data_dir)
: ALLOW_THIS_IN_INITIALIZER_LIST(
select_file_dialog_(SelectFileDialog::Create(this))),
is_blocking_(true) {
- std::wstring message_text = UTF16ToWide(l10n_util::GetStringFUTF16(
+ string16 message_text = l10n_util::GetStringFUTF16(
IDS_CANT_WRITE_USER_DIRECTORY_SUMMARY,
- user_data_dir.LossyDisplayName()));
+ user_data_dir.LossyDisplayName());
const int kDialogWidth = 400;
message_box_view_ = new views::MessageBoxView(
ui::MessageBoxFlags::kIsConfirmMessageBox,
- message_text.c_str(), std::wstring(), kDialogWidth);
+ message_text,
+ string16(),
+ kDialogWidth);
views::Widget::CreateWindow(this)->Show();
}
diff --git a/views/controls/message_box_view.cc b/views/controls/message_box_view.cc
index a11edbd..5862460 100644
--- a/views/controls/message_box_view.cc
+++ b/views/controls/message_box_view.cc
@@ -21,7 +21,7 @@
#include "views/widget/widget.h"
#include "views/window/client_view.h"
-static const int kDefaultMessageWidth = 320;
+const int kDefaultMessageWidth = 320;
namespace views {
@@ -29,10 +29,10 @@ namespace views {
// MessageBoxView, public:
MessageBoxView::MessageBoxView(int dialog_flags,
- const std::wstring& message,
- const std::wstring& default_prompt,
+ const string16& message,
+ const string16& default_prompt,
int message_width)
- : message_label_(new Label(WideToUTF16Hack(message))),
+ : message_label_(new Label(message)),
prompt_field_(NULL),
icon_(NULL),
checkbox_(NULL),
@@ -41,9 +41,9 @@ MessageBoxView::MessageBoxView(int dialog_flags,
}
MessageBoxView::MessageBoxView(int dialog_flags,
- const std::wstring& message,
- const std::wstring& default_prompt)
- : message_label_(new Label(WideToUTF16Hack(message))),
+ const string16& message,
+ const string16& default_prompt)
+ : message_label_(new Label(message)),
prompt_field_(NULL),
icon_(NULL),
checkbox_(NULL),
@@ -69,11 +69,11 @@ void MessageBoxView::SetIcon(const SkBitmap& icon) {
ResetLayoutManager();
}
-void MessageBoxView::SetCheckBoxLabel(const std::wstring& label) {
+void MessageBoxView::SetCheckBoxLabel(const string16& label) {
if (!checkbox_)
- checkbox_ = new Checkbox(label);
+ checkbox_ = new Checkbox(UTF16ToWideHack(label));
else
- checkbox_->SetText(label);
+ checkbox_->SetText(UTF16ToWideHack(label));
ResetLayoutManager();
}
@@ -127,7 +127,7 @@ bool MessageBoxView::AcceleratorPressed(
// MessageBoxView, private:
void MessageBoxView::Init(int dialog_flags,
- const std::wstring& default_prompt) {
+ const string16& default_prompt) {
message_label_->SetMultiLine(true);
message_label_->SetAllowCharacterBreak(true);
if (dialog_flags & ui::MessageBoxFlags::kAutoDetectAlignment) {
@@ -152,7 +152,7 @@ void MessageBoxView::Init(int dialog_flags,
if (dialog_flags & ui::MessageBoxFlags::kFlagHasPromptField) {
prompt_field_ = new Textfield;
- prompt_field_->SetText(WideToUTF16Hack(default_prompt));
+ prompt_field_->SetText(default_prompt);
}
ResetLayoutManager();
diff --git a/views/controls/message_box_view.h b/views/controls/message_box_view.h
index e278d38..453f29a 100644
--- a/views/controls/message_box_view.h
+++ b/views/controls/message_box_view.h
@@ -24,13 +24,13 @@ class Textfield;
class VIEWS_EXPORT MessageBoxView : public View {
public:
MessageBoxView(int dialog_flags,
- const std::wstring& message,
- const std::wstring& default_prompt,
+ const string16& message,
+ const string16& default_prompt,
int message_width);
MessageBoxView(int dialog_flags,
- const std::wstring& message,
- const std::wstring& default_prompt);
+ const string16& message,
+ const string16& default_prompt);
virtual ~MessageBoxView();
@@ -51,7 +51,7 @@ class VIEWS_EXPORT MessageBoxView : public View {
// Adds a checkbox with the specified label to the message box if this is the
// first call. Otherwise, it changes the label of the current checkbox. To
// start, the message box has no checkbox until this function is called.
- void SetCheckBoxLabel(const std::wstring& label);
+ void SetCheckBoxLabel(const string16& label);
// Sets the state of the check-box.
void SetCheckBoxSelected(bool selected);
@@ -71,7 +71,7 @@ class VIEWS_EXPORT MessageBoxView : public View {
private:
// Sets up the layout manager and initializes the prompt field. This should
// only be called once, from the constructor.
- void Init(int dialog_flags, const std::wstring& default_prompt);
+ void Init(int dialog_flags, const string16& default_prompt);
// Sets up the layout manager based on currently initialized views. Should be
// called when a view is initialized or changed.
diff --git a/views/examples/message_box_example.cc b/views/examples/message_box_example.cc
index b46eb63..6d7d8f53 100644
--- a/views/examples/message_box_example.cc
+++ b/views/examples/message_box_example.cc
@@ -20,14 +20,16 @@ MessageBoxExample::~MessageBoxExample() {
void MessageBoxExample::CreateExampleView(views::View* container) {
message_box_view_ = new views::MessageBoxView(
- 0, L"Message Box Message", L"Default Prompt");
+ 0,
+ ASCIIToUTF16("Message Box Message"),
+ ASCIIToUTF16("Default Prompt"));
status_ = new views::TextButton(this, L"Show Status");
toggle_ = new views::TextButton(this, L"Toggle Checkbox");
views::GridLayout* layout = new views::GridLayout(container);
container->SetLayoutManager(layout);
- message_box_view_->SetCheckBoxLabel(L"Check Box");
+ message_box_view_->SetCheckBoxLabel(ASCIIToUTF16("Check Box"));
const int message_box_column = 0;
views::ColumnSet* column_set = layout->AddColumnSet(message_box_column);
@@ -53,7 +55,7 @@ void MessageBoxExample::ButtonPressed(views::Button* sender,
const views::Event& event) {
if (sender == status_) {
message_box_view_->SetCheckBoxLabel(
- ASCIIToWide(BoolToOnOff(message_box_view_->IsCheckBoxSelected())));
+ ASCIIToUTF16(BoolToOnOff(message_box_view_->IsCheckBoxSelected())));
PrintStatus(message_box_view_->IsCheckBoxSelected() ?
"Check Box Selected" : "Check Box Not Selected");
} else if (sender == toggle_) {