OLD | NEW |
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 "chrome/browser/ui/views/edit_search_engine_dialog.h" | 5 #include "chrome/browser/ui/views/edit_search_engine_dialog.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/search_engines/template_url.h" | 10 #include "chrome/browser/search_engines/template_url.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 string16::size_type percent_index = | 205 string16::size_type percent_index = |
206 description.find(ASCIIToUTF16("%s"), | 206 description.find(ASCIIToUTF16("%s"), |
207 static_cast<string16::size_type>(0)); | 207 static_cast<string16::size_type>(0)); |
208 if (percent_index != string16::npos) | 208 if (percent_index != string16::npos) |
209 description.replace(percent_index, | 209 description.replace(percent_index, |
210 reversed_percent.length(), | 210 reversed_percent.length(), |
211 reversed_percent); | 211 reversed_percent); |
212 } | 212 } |
213 | 213 |
214 views::Label* description_label = new views::Label(description); | 214 views::Label* description_label = new views::Label(description); |
215 description_label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 215 description_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
216 layout->AddView(description_label); | 216 layout->AddView(description_label); |
217 | 217 |
218 layout->AddPaddingRow(0, related_y); | 218 layout->AddPaddingRow(0, related_y); |
219 } | 219 } |
220 | 220 |
221 views::Label* EditSearchEngineDialog::CreateLabel(int message_id) { | 221 views::Label* EditSearchEngineDialog::CreateLabel(int message_id) { |
222 views::Label* label = | 222 views::Label* label = |
223 new views::Label(l10n_util::GetStringUTF16(message_id)); | 223 new views::Label(l10n_util::GetStringUTF16(message_id)); |
224 label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 224 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
225 return label; | 225 return label; |
226 } | 226 } |
227 | 227 |
228 Textfield* EditSearchEngineDialog::CreateTextfield(const string16& text, | 228 Textfield* EditSearchEngineDialog::CreateTextfield(const string16& text, |
229 bool lowercase) { | 229 bool lowercase) { |
230 Textfield* text_field = new Textfield( | 230 Textfield* text_field = new Textfield( |
231 lowercase ? Textfield::STYLE_LOWERCASE : Textfield::STYLE_DEFAULT); | 231 lowercase ? Textfield::STYLE_LOWERCASE : Textfield::STYLE_DEFAULT); |
232 text_field->SetText(text); | 232 text_field->SetText(text); |
233 text_field->SetController(this); | 233 text_field->SetController(this); |
234 return text_field; | 234 return text_field; |
(...skipping 14 matching lines...) Expand all Loading... |
249 int invalid_message_id) { | 249 int invalid_message_id) { |
250 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 250 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
251 if (is_valid) { | 251 if (is_valid) { |
252 image_view->SetTooltipText(string16()); | 252 image_view->SetTooltipText(string16()); |
253 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_GOOD)); | 253 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_GOOD)); |
254 } else { | 254 } else { |
255 image_view->SetTooltipText(l10n_util::GetStringUTF16(invalid_message_id)); | 255 image_view->SetTooltipText(l10n_util::GetStringUTF16(invalid_message_id)); |
256 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_ALERT)); | 256 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_ALERT)); |
257 } | 257 } |
258 } | 258 } |
OLD | NEW |