summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/edit_keyword_controller.cc
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-26 00:26:26 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-26 00:26:26 +0000
commit802cbf0fc2d88085b7ef5c5fa01d32b261287d6f (patch)
tree7b78d590d1aba7623ac8c82cbca9de766fc216a3 /chrome/browser/views/edit_keyword_controller.cc
parentf42d28c678cd72979d64eebed9ea879c59e2576a (diff)
downloadchromium_src-802cbf0fc2d88085b7ef5c5fa01d32b261287d6f.zip
chromium_src-802cbf0fc2d88085b7ef5c5fa01d32b261287d6f.tar.gz
chromium_src-802cbf0fc2d88085b7ef5c5fa01d32b261287d6f.tar.bz2
Changes keyword editor to map all input in the keyword field to lower
case. BUG=4520 TEST=bring up the keyword editor, type some text and make sure it gets mapped to lower case. Review URL: http://codereview.chromium.org/12452 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6018 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/edit_keyword_controller.cc')
-rw-r--r--chrome/browser/views/edit_keyword_controller.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/chrome/browser/views/edit_keyword_controller.cc b/chrome/browser/views/edit_keyword_controller.cc
index 0ae528b..efbb43e 100644
--- a/chrome/browser/views/edit_keyword_controller.cc
+++ b/chrome/browser/views/edit_keyword_controller.cc
@@ -173,16 +173,16 @@ void EditKeywordController::Init() {
// Create the views we'll need.
view_ = new views::View();
if (template_url_) {
- title_tf_ = CreateTextField(template_url_->short_name());
- keyword_tf_ = CreateTextField(template_url_->keyword());
- url_tf_ = CreateTextField(GetDisplayURL(*template_url_));
+ title_tf_ = CreateTextField(template_url_->short_name(), false);
+ keyword_tf_ = CreateTextField(template_url_->keyword(), true);
+ url_tf_ = CreateTextField(GetDisplayURL(*template_url_), false);
// We don't allow users to edit prepopulate URLs. This is done as
// occasionally we need to update the URL of prepopulated TemplateURLs.
url_tf_->SetReadOnly(template_url_->prepopulate_id() != 0);
} else {
- title_tf_ = CreateTextField(std::wstring());
- keyword_tf_ = CreateTextField(std::wstring());
- url_tf_ = CreateTextField(std::wstring());
+ title_tf_ = CreateTextField(std::wstring(), false);
+ keyword_tf_ = CreateTextField(std::wstring(), true);
+ url_tf_ = CreateTextField(std::wstring(), false);
}
title_iv_ = new ImageView();
keyword_iv_ = new ImageView();
@@ -277,8 +277,10 @@ views::Label* EditKeywordController::CreateLabel(int message_id) {
return label;
}
-TextField* EditKeywordController::CreateTextField(const std::wstring& text) {
- TextField* text_field = new TextField();
+TextField* EditKeywordController::CreateTextField(const std::wstring& text,
+ bool lowercase) {
+ TextField* text_field = new TextField(
+ lowercase ? TextField::STYLE_LOWERCASE : TextField::STYLE_DEFAULT);
text_field->SetText(text);
text_field->SetController(this);
return text_field;