Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java

Issue 2815103004: Android: convert kEnumName to ENUM_NAME in java_cpp_enum.py. (Closed)
Patch Set: Address agrieve@ comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java
index f6957c54f7bd79d31613a354e0d865e182196199..49726776c49baedb8e0e14ee3e365a438b160e87 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java
@@ -41,22 +41,22 @@ public class ImeUtils {
outAttrs.inputType =
EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT;
- if ((inputFlags & WebTextInputFlags.kAutocompleteOff) != 0) {
+ if ((inputFlags & WebTextInputFlags.AUTOCOMPLETE_OFF) != 0) {
outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
}
int imeAction = 0;
- if (inputMode == WebTextInputMode.kDefault) {
+ if (inputMode == WebTextInputMode.DEFAULT) {
if (inputType == TextInputType.TEXT) {
// Normal text field
imeAction = EditorInfo.IME_ACTION_GO;
- if ((inputFlags & WebTextInputFlags.kAutocorrectOff) == 0) {
+ if ((inputFlags & WebTextInputFlags.AUTOCORRECT_OFF) == 0) {
outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT;
}
} else if (inputType == TextInputType.TEXT_AREA
|| inputType == TextInputType.CONTENT_EDITABLE) {
outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE;
- if ((inputFlags & WebTextInputFlags.kAutocorrectOff) == 0) {
+ if ((inputFlags & WebTextInputFlags.AUTOCORRECT_OFF) == 0) {
outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT;
}
imeAction = EditorInfo.IME_ACTION_NONE;
@@ -90,36 +90,36 @@ public class ImeUtils {
} else {
switch (inputMode) {
default:
- case WebTextInputMode.kDefault:
- case WebTextInputMode.kVerbatim:
- case WebTextInputMode.kLatin:
- case WebTextInputMode.kLatinName:
- case WebTextInputMode.kLatinProse:
- case WebTextInputMode.kFullWidthLatin:
- case WebTextInputMode.kKana:
- case WebTextInputMode.kKanaName:
- case WebTextInputMode.kKataKana:
+ case WebTextInputMode.DEFAULT:
+ case WebTextInputMode.VERBATIM:
+ case WebTextInputMode.LATIN:
+ case WebTextInputMode.LATIN_NAME:
+ case WebTextInputMode.LATIN_PROSE:
+ case WebTextInputMode.FULL_WIDTH_LATIN:
+ case WebTextInputMode.KANA:
+ case WebTextInputMode.KANA_NAME:
+ case WebTextInputMode.KATA_KANA:
outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE;
- if ((inputFlags & WebTextInputFlags.kAutocorrectOff) == 0) {
+ if ((inputFlags & WebTextInputFlags.AUTOCORRECT_OFF) == 0) {
outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT;
}
imeAction = EditorInfo.IME_ACTION_NONE;
break;
- case WebTextInputMode.kNumeric:
+ case WebTextInputMode.NUMERIC:
outAttrs.inputType =
InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_NORMAL;
imeAction = EditorInfo.IME_ACTION_NEXT;
break;
- case WebTextInputMode.kTel:
+ case WebTextInputMode.TEL:
outAttrs.inputType = InputType.TYPE_CLASS_PHONE;
imeAction = EditorInfo.IME_ACTION_NEXT;
break;
- case WebTextInputMode.kEmail:
+ case WebTextInputMode.EMAIL:
outAttrs.inputType = InputType.TYPE_CLASS_TEXT
| InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
imeAction = EditorInfo.IME_ACTION_GO;
break;
- case WebTextInputMode.kUrl:
+ case WebTextInputMode.URL:
outAttrs.inputType =
InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI;
imeAction = EditorInfo.IME_ACTION_NEXT;
@@ -132,11 +132,11 @@ public class ImeUtils {
// type. This is not using AutocapitalizeNone because Android does not autocapitalize by
// default and there is no way to express no capitalization.
// Autocapitalize is meant as a hint to the virtual keyboard.
- if ((inputFlags & WebTextInputFlags.kAutocapitalizeCharacters) != 0) {
+ if ((inputFlags & WebTextInputFlags.AUTOCAPITALIZE_CHARACTERS) != 0) {
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS;
- } else if ((inputFlags & WebTextInputFlags.kAutocapitalizeWords) != 0) {
+ } else if ((inputFlags & WebTextInputFlags.AUTOCAPITALIZE_WORDS) != 0) {
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_WORDS;
- } else if ((inputFlags & WebTextInputFlags.kAutocapitalizeSentences) != 0) {
+ } else if ((inputFlags & WebTextInputFlags.AUTOCAPITALIZE_SENTENCES) != 0) {
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
}
// Content editable doesn't use autocapitalize so we need to set it manually.

Powered by Google App Engine
This is Rietveld 408576698