summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorxji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-07 23:13:11 +0000
committerxji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-07 23:13:11 +0000
commitda244100d3ac663a1f827fc712dc508c7761d207 (patch)
tree4f8457737df65fb3e204498d867d379f2cee0c79 /views
parent7b3fbe1dee9db971861c3af0796f0f0fbeaae271 (diff)
downloadchromium_src-da244100d3ac663a1f827fc712dc508c7761d207.zip
chromium_src-da244100d3ac663a1f827fc712dc508c7761d207.tar.gz
chromium_src-da244100d3ac663a1f827fc712dc508c7761d207.tar.bz2
This CL fixes issue 42867 - "OK" button disabled on "Edit Exception" dialog box
when URL is modified in non-empty input field - RTL In RTL chrome in windows, the text get from "Pattern" text field is wrapped with LRE/POP, which makes the pattern invalid. Trim explicit bidi control characters off in NativeTextfieldWin::GetText(). BUG=http://crbug.com/42867 TEST= 1. Launch Chrome with RTL language UI 2. click Wrench => Options => Under the Hood => Content settings => Exceptions => Edit... 3. modify an existing url on the Pattern field. The "OK" button should not be grayed out. Review URL: http://codereview.chromium.org/1703026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/textfield/native_textfield_win.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/views/controls/textfield/native_textfield_win.cc b/views/controls/textfield/native_textfield_win.cc
index 13cf93b..a981b79 100644
--- a/views/controls/textfield/native_textfield_win.cc
+++ b/views/controls/textfield/native_textfield_win.cc
@@ -14,6 +14,7 @@
#include "base/i18n/rtl.h"
#include "base/keyboard_codes.h"
#include "base/string_util.h"
+#include "base/utf_string_conversions.h"
#include "base/win_util.h"
#include "gfx/native_theme_win.h"
#include "grit/app_strings.h"
@@ -124,7 +125,13 @@ string16 NativeTextfieldWin::GetText() const {
int len = GetTextLength() + 1;
std::wstring str;
GetWindowText(WriteInto(&str, len), len);
- return str;
+ // The text get from GetWindowText() might be wrapped with explicit bidi
+ // control characters. Refer to UpdateText() for detail. Without such
+ // wrapping, in RTL chrome, a pure LTR string ending with parenthesis will
+ // not be displayed correctly in a textfield. For example, "Yahoo!" will be
+ // displayed as "!Yahoo", and "Google (by default)" will be displayed as
+ // "(Google (by default".
+ return base::i18n::StripWrappingBidiControlCharacters(WideToUTF16(str));
}
void NativeTextfieldWin::UpdateText() {