summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshuchen <shuchen@chromium.org>2014-10-22 18:55:20 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-23 02:00:06 +0000
commit82ce8c52345cd8ba927e05d370ef328a1112df71 (patch)
treef77694275503780950153046841183990169e7f0
parentdaa9107a10bca2c1ca762c7fefdeacad5a414c7b (diff)
downloadchromium_src-82ce8c52345cd8ba927e05d370ef328a1112df71.zip
chromium_src-82ce8c52345cd8ba927e05d370ef328a1112df71.tar.gz
chromium_src-82ce8c52345cd8ba927e05d370ef328a1112df71.tar.bz2
Exposes the text input flags to ChromeOS IME extensions.
BUG=419127 TEST=Verified on linux_chromeos. Review URL: https://codereview.chromium.org/659323003 Cr-Commit-Position: refs/heads/master@{#300820}
-rw-r--r--chrome/browser/chromeos/input_method/input_method_engine.cc13
-rw-r--r--chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc25
-rw-r--r--chrome/browser/chromeos/input_method/input_method_engine_interface.h3
-rw-r--r--chrome/browser/chromeos/input_method/input_method_engine_unittest.cc3
-rw-r--r--chrome/browser/extensions/api/input_ime/input_ime_api.cc3
-rw-r--r--chrome/common/extensions/api/input_ime.json5
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest.cc9
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest.h4
-rw-r--r--content/browser/frame_host/render_widget_host_view_child_frame.cc3
-rw-r--r--content/browser/frame_host/render_widget_host_view_child_frame.h3
-rw-r--r--content/browser/frame_host/render_widget_host_view_guest.cc5
-rw-r--r--content/browser/frame_host/render_widget_host_view_guest.h3
-rw-r--r--content/browser/renderer_host/render_widget_host_impl.cc5
-rw-r--r--content/browser/renderer_host/render_widget_host_impl.h3
-rw-r--r--content/browser/renderer_host/render_widget_host_view_android.cc3
-rw-r--r--content/browser/renderer_host/render_widget_host_view_android.h3
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.cc13
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.h6
-rw-r--r--content/browser/renderer_host/render_widget_host_view_base.h3
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac.h3
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac.mm3
-rw-r--r--content/common/view_messages.h5
-rw-r--r--content/renderer/npapi/webplugin_delegate_proxy.cc2
-rw-r--r--content/renderer/render_widget.cc13
-rw-r--r--content/renderer/render_widget.h3
-rw-r--r--content/test/test_render_view_host.h3
-rw-r--r--ui/base/ime/chromeos/ime_bridge.h7
-rw-r--r--ui/base/ime/chromeos/mock_ime_engine_handler.cc4
-rw-r--r--ui/base/ime/dummy_input_method.cc4
-rw-r--r--ui/base/ime/dummy_input_method.h1
-rw-r--r--ui/base/ime/dummy_text_input_client.cc4
-rw-r--r--ui/base/ime/dummy_text_input_client.h1
-rw-r--r--ui/base/ime/input_method.h4
-rw-r--r--ui/base/ime/input_method_base.cc5
-rw-r--r--ui/base/ime/input_method_base.h1
-rw-r--r--ui/base/ime/input_method_chromeos.cc4
-rw-r--r--ui/base/ime/input_method_chromeos_unittest.cc3
-rw-r--r--ui/base/ime/mock_input_method.cc4
-rw-r--r--ui/base/ime/mock_input_method.h1
-rw-r--r--ui/base/ime/remote_input_method_win.cc5
-rw-r--r--ui/base/ime/text_input_client.h5
-rw-r--r--ui/base/ime/text_input_flags.h24
-rw-r--r--ui/views/controls/prefix_selector.cc4
-rw-r--r--ui/views/controls/prefix_selector.h1
-rw-r--r--ui/views/controls/textfield/textfield.cc4
-rw-r--r--ui/views/controls/textfield/textfield.h1
-rw-r--r--ui/views/ime/input_method_bridge.cc5
-rw-r--r--ui/views/ime/input_method_bridge.h1
48 files changed, 196 insertions, 44 deletions
diff --git a/chrome/browser/chromeos/input_method/input_method_engine.cc b/chrome/browser/chromeos/input_method/input_method_engine.cc
index 406a2cd..d7e48fb 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine.cc
@@ -27,6 +27,7 @@
#include "ui/aura/window_tree_host.h"
#include "ui/base/ime/candidate_window.h"
#include "ui/base/ime/chromeos/ime_keymap.h"
+#include "ui/base/ime/text_input_flags.h"
#include "ui/events/event.h"
#include "ui/events/event_processor.h"
#include "ui/events/keycodes/dom4/keycode_converter.h"
@@ -566,6 +567,13 @@ void InputMethodEngine::FocusIn(
break;
}
+ context.auto_correct =
+ !(input_context.flags & ui::TEXT_INPUT_FLAG_AUTOCORRECT_OFF);
+ context.auto_complete =
+ !(input_context.flags & ui::TEXT_INPUT_FLAG_AUTOCOMPLETE_OFF);
+ context.spell_check =
+ !(input_context.flags & ui::TEXT_INPUT_FLAG_SPELLCHECK_OFF);
+
observer_->OnFocus(context);
}
@@ -585,8 +593,9 @@ void InputMethodEngine::Enable(const std::string& component_id) {
active_component_id_ = component_id;
observer_->OnActivate(component_id);
current_input_type_ = IMEBridge::Get()->GetCurrentTextInputType();
- FocusIn(IMEEngineHandlerInterface::InputContext(
- current_input_type_, ui::TEXT_INPUT_MODE_DEFAULT));
+ FocusIn(IMEEngineHandlerInterface::InputContext(current_input_type_,
+ ui::TEXT_INPUT_MODE_DEFAULT,
+ ui::TEXT_INPUT_FLAG_NONE));
EnableInputView();
}
diff --git a/chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc b/chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc
index cc4b628..efdebc5 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc
@@ -20,6 +20,7 @@
#include "ui/base/ime/chromeos/ime_bridge.h"
#include "ui/base/ime/chromeos/mock_ime_candidate_window_handler.h"
#include "ui/base/ime/chromeos/mock_ime_input_context_handler.h"
+#include "ui/base/ime/text_input_flags.h"
#include "ui/events/event.h"
namespace chromeos {
@@ -172,7 +173,8 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
// onFocus event should be fired if FocusIn function is called.
ExtensionTestMessageListener focus_listener("onFocus:text", false);
IMEEngineHandlerInterface::InputContext context(ui::TEXT_INPUT_TYPE_TEXT,
- ui::TEXT_INPUT_MODE_DEFAULT);
+ ui::TEXT_INPUT_MODE_DEFAULT,
+ ui::TEXT_INPUT_FLAG_NONE);
engine_handler->FocusIn(context);
ASSERT_TRUE(focus_listener.WaitUntilSatisfied());
ASSERT_TRUE(focus_listener.was_satisfied());
@@ -252,7 +254,8 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
engine_handler->Enable("APIArgumentIME");
IMEEngineHandlerInterface::InputContext context(ui::TEXT_INPUT_TYPE_TEXT,
- ui::TEXT_INPUT_MODE_DEFAULT);
+ ui::TEXT_INPUT_MODE_DEFAULT,
+ ui::TEXT_INPUT_FLAG_NONE);
engine_handler->FocusIn(context);
{
@@ -929,7 +932,8 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
{
ExtensionTestMessageListener focus_listener("onFocus:text", false);
IMEEngineHandlerInterface::InputContext context(
- ui::TEXT_INPUT_TYPE_TEXT, ui::TEXT_INPUT_MODE_DEFAULT);
+ ui::TEXT_INPUT_TYPE_TEXT, ui::TEXT_INPUT_MODE_DEFAULT,
+ ui::TEXT_INPUT_FLAG_NONE);
engine_handler->FocusIn(context);
ASSERT_TRUE(focus_listener.WaitUntilSatisfied());
ASSERT_TRUE(focus_listener.was_satisfied());
@@ -937,7 +941,8 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
{
ExtensionTestMessageListener focus_listener("onFocus:search", false);
IMEEngineHandlerInterface::InputContext context(
- ui::TEXT_INPUT_TYPE_SEARCH, ui::TEXT_INPUT_MODE_DEFAULT);
+ ui::TEXT_INPUT_TYPE_SEARCH, ui::TEXT_INPUT_MODE_DEFAULT,
+ ui::TEXT_INPUT_FLAG_NONE);
engine_handler->FocusIn(context);
ASSERT_TRUE(focus_listener.WaitUntilSatisfied());
ASSERT_TRUE(focus_listener.was_satisfied());
@@ -945,7 +950,8 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
{
ExtensionTestMessageListener focus_listener("onFocus:tel", false);
IMEEngineHandlerInterface::InputContext context(
- ui::TEXT_INPUT_TYPE_TELEPHONE, ui::TEXT_INPUT_MODE_DEFAULT);
+ ui::TEXT_INPUT_TYPE_TELEPHONE, ui::TEXT_INPUT_MODE_DEFAULT,
+ ui::TEXT_INPUT_FLAG_NONE);
engine_handler->FocusIn(context);
ASSERT_TRUE(focus_listener.WaitUntilSatisfied());
ASSERT_TRUE(focus_listener.was_satisfied());
@@ -953,7 +959,8 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
{
ExtensionTestMessageListener focus_listener("onFocus:url", false);
IMEEngineHandlerInterface::InputContext context(
- ui::TEXT_INPUT_TYPE_URL, ui::TEXT_INPUT_MODE_DEFAULT);
+ ui::TEXT_INPUT_TYPE_URL, ui::TEXT_INPUT_MODE_DEFAULT,
+ ui::TEXT_INPUT_FLAG_NONE);
engine_handler->FocusIn(context);
ASSERT_TRUE(focus_listener.WaitUntilSatisfied());
ASSERT_TRUE(focus_listener.was_satisfied());
@@ -961,7 +968,8 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
{
ExtensionTestMessageListener focus_listener("onFocus:email", false);
IMEEngineHandlerInterface::InputContext context(
- ui::TEXT_INPUT_TYPE_EMAIL, ui::TEXT_INPUT_MODE_DEFAULT);
+ ui::TEXT_INPUT_TYPE_EMAIL, ui::TEXT_INPUT_MODE_DEFAULT,
+ ui::TEXT_INPUT_FLAG_NONE);
engine_handler->FocusIn(context);
ASSERT_TRUE(focus_listener.WaitUntilSatisfied());
ASSERT_TRUE(focus_listener.was_satisfied());
@@ -969,7 +977,8 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
{
ExtensionTestMessageListener focus_listener("onFocus:number", false);
IMEEngineHandlerInterface::InputContext context(
- ui::TEXT_INPUT_TYPE_NUMBER, ui::TEXT_INPUT_MODE_DEFAULT);
+ ui::TEXT_INPUT_TYPE_NUMBER, ui::TEXT_INPUT_MODE_DEFAULT,
+ ui::TEXT_INPUT_FLAG_NONE);
engine_handler->FocusIn(context);
ASSERT_TRUE(focus_listener.WaitUntilSatisfied());
ASSERT_TRUE(focus_listener.was_satisfied());
diff --git a/chrome/browser/chromeos/input_method/input_method_engine_interface.h b/chrome/browser/chromeos/input_method/input_method_engine_interface.h
index edd0a8c..b7ffe9b 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine_interface.h
+++ b/chrome/browser/chromeos/input_method/input_method_engine_interface.h
@@ -89,6 +89,9 @@ class InputMethodEngineInterface : public IMEEngineHandlerInterface {
struct InputContext {
int id;
std::string type;
+ bool auto_correct;
+ bool auto_complete;
+ bool spell_check;
};
struct UsageEntry {
diff --git a/chrome/browser/chromeos/input_method/input_method_engine_unittest.cc b/chrome/browser/chromeos/input_method/input_method_engine_unittest.cc
index 1edbbf0..0401f41 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine_unittest.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine_unittest.cc
@@ -15,6 +15,7 @@
#include "chromeos/ime/mock_component_extension_ime_manager_delegate.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/ime/chromeos/mock_ime_input_context_handler.h"
+#include "ui/base/ime/text_input_flags.h"
namespace chromeos {
@@ -138,7 +139,7 @@ class InputMethodEngineTest : public testing::Test {
void FocusIn(ui::TextInputType input_type) {
IMEEngineHandlerInterface::InputContext input_context(
- input_type, ui::TEXT_INPUT_MODE_DEFAULT);
+ input_type, ui::TEXT_INPUT_MODE_DEFAULT, ui::TEXT_INPUT_FLAG_NONE);
engine_->FocusIn(input_context);
IMEBridge::Get()->SetCurrentTextInputType(input_type);
}
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.cc b/chrome/browser/extensions/api/input_ime/input_ime_api.cc
index abef9a0e..0d0dea3 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api.cc
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api.cc
@@ -135,6 +135,9 @@ class ImeObserver : public InputMethodEngineInterface::Observer {
input_ime::InputContext context_value;
context_value.context_id = context.id;
context_value.type = input_ime::InputContext::ParseType(context.type);
+ context_value.auto_correct = context.auto_correct;
+ context_value.auto_complete = context.auto_complete;
+ context_value.spell_check = context.spell_check;
scoped_ptr<base::ListValue> args(input_ime::OnFocus::Create(context_value));
diff --git a/chrome/common/extensions/api/input_ime.json b/chrome/common/extensions/api/input_ime.json
index 5d9b212..10671c4 100644
--- a/chrome/common/extensions/api/input_ime.json
+++ b/chrome/common/extensions/api/input_ime.json
@@ -31,7 +31,10 @@
"description": "Describes an input Context",
"properties": {
"contextID": {"type": "integer", "description": "This is used to specify targets of text field operations. This ID becomes invalid as soon as onBlur is called."},
- "type": {"type": "string", "description": "Type of value this text field edits, (Text, Number, URL, etc)", "enum": ["text", "search", "tel", "url", "email", "number", "password"]}
+ "type": {"type": "string", "description": "Type of value this text field edits, (Text, Number, URL, etc)", "enum": ["text", "search", "tel", "url", "email", "number", "password"]},
+ "autoCorrect": {"type": "boolean", "description": "Whether the text field wants auto-correct."},
+ "autoComplete": {"type": "boolean", "description": "Whether the text field wants auto-complete."},
+ "spellCheck": {"type": "boolean", "description": "Whether the text field wants spell-check."}
}
},
{
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 68876ea..ea6a573 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -86,6 +86,7 @@ BrowserPluginGuest::BrowserPluginGuest(bool has_render_view,
is_in_destruction_(false),
last_text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
last_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT),
+ last_input_flags_(0),
last_can_compose_inline_(true),
guest_proxy_routing_id_(MSG_ROUTING_NONE),
delegate_(delegate),
@@ -121,7 +122,7 @@ void BrowserPluginGuest::SetFocus(RenderWidgetHost* rwh, bool focused) {
rwh->GetView());
if (rwhv) {
rwhv->TextInputTypeChanged(last_text_input_type_, last_input_mode_,
- last_can_compose_inline_);
+ last_can_compose_inline_, last_input_flags_);
}
}
@@ -800,15 +801,17 @@ void BrowserPluginGuest::OnTakeFocus(bool reverse) {
void BrowserPluginGuest::OnTextInputTypeChanged(ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) {
+ bool can_compose_inline,
+ int flags) {
// Save the state of text input so we can restore it on focus.
last_text_input_type_ = type;
last_input_mode_ = input_mode;
+ last_input_flags_ = flags;
last_can_compose_inline_ = can_compose_inline;
static_cast<RenderWidgetHostViewBase*>(
web_contents()->GetRenderWidgetHostView())->TextInputTypeChanged(
- type, input_mode, can_compose_inline);
+ type, input_mode, can_compose_inline, flags);
}
void BrowserPluginGuest::OnImeCancelComposition() {
diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h
index be25d09..1cc9e02 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.h
+++ b/content/browser/browser_plugin/browser_plugin_guest.h
@@ -290,7 +290,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver {
void OnTextInputTypeChanged(ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline);
+ bool can_compose_inline,
+ int flags);
void OnImeSetComposition(
int instance_id,
const std::string& text,
@@ -371,6 +372,7 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver {
// Text input type states.
ui::TextInputType last_text_input_type_;
ui::TextInputMode last_input_mode_;
+ int last_input_flags_;
bool last_can_compose_inline_;
// The is the routing ID for a swapped out RenderView for the guest
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.cc b/content/browser/frame_host/render_widget_host_view_child_frame.cc
index ba0c94a..525ddff 100644
--- a/content/browser/frame_host/render_widget_host_view_child_frame.cc
+++ b/content/browser/frame_host/render_widget_host_view_child_frame.cc
@@ -153,7 +153,8 @@ void RenderWidgetHostViewChildFrame::SetIsLoading(bool is_loading) {
void RenderWidgetHostViewChildFrame::TextInputTypeChanged(
ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) {
+ bool can_compose_inline,
+ int flags) {
NOTREACHED();
}
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.h b/content/browser/frame_host/render_widget_host_view_child_frame.h
index 4774d55..804a79d 100644
--- a/content/browser/frame_host/render_widget_host_view_child_frame.h
+++ b/content/browser/frame_host/render_widget_host_view_child_frame.h
@@ -66,7 +66,8 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
void SetIsLoading(bool is_loading) override;
void TextInputTypeChanged(ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) override;
+ bool can_compose_inline,
+ int flags) override;
void ImeCancelComposition() override;
#if defined(OS_MACOSX) || defined(USE_AURA)
void ImeCompositionRangeChanged(
diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc
index 20782e8..186e27f 100644
--- a/content/browser/frame_host/render_widget_host_view_guest.cc
+++ b/content/browser/frame_host/render_widget_host_view_guest.cc
@@ -284,7 +284,8 @@ void RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) {
void RenderWidgetHostViewGuest::TextInputTypeChanged(
ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) {
+ bool can_compose_inline,
+ int flags) {
if (!guest_)
return;
@@ -292,7 +293,7 @@ void RenderWidgetHostViewGuest::TextInputTypeChanged(
if (!rwhv)
return;
// Forward the information to embedding RWHV.
- rwhv->TextInputTypeChanged(type, input_mode, can_compose_inline);
+ rwhv->TextInputTypeChanged(type, input_mode, can_compose_inline, flags);
}
void RenderWidgetHostViewGuest::ImeCancelComposition() {
diff --git a/content/browser/frame_host/render_widget_host_view_guest.h b/content/browser/frame_host/render_widget_host_view_guest.h
index 2d6a880..51c0a48 100644
--- a/content/browser/frame_host/render_widget_host_view_guest.h
+++ b/content/browser/frame_host/render_widget_host_view_guest.h
@@ -74,7 +74,8 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest
void SetIsLoading(bool is_loading) override;
void TextInputTypeChanged(ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) override;
+ bool can_compose_inline,
+ int flags) override;
void ImeCancelComposition() override;
#if defined(OS_MACOSX) || defined(USE_AURA)
void ImeCompositionRangeChanged(
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 47cfba2..64a6654 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -1680,9 +1680,10 @@ void RenderWidgetHostImpl::SetTouchEventEmulationEnabled(bool enabled) {
void RenderWidgetHostImpl::OnTextInputTypeChanged(
ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) {
+ bool can_compose_inline,
+ int flags) {
if (view_)
- view_->TextInputTypeChanged(type, input_mode, can_compose_inline);
+ view_->TextInputTypeChanged(type, input_mode, can_compose_inline, flags);
}
#if defined(OS_MACOSX) || defined(USE_AURA)
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index de95733..8423beb 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -598,7 +598,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
void OnSetCursor(const WebCursor& cursor);
void OnTextInputTypeChanged(ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline);
+ bool can_compose_inline,
+ int flags);
#if defined(OS_MACOSX) || defined(USE_AURA)
void OnImeCompositionRangeChanged(
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 1c97a71..0343568 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -625,7 +625,8 @@ void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) {
void RenderWidgetHostViewAndroid::TextInputTypeChanged(
ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) {
+ bool can_compose_inline,
+ int flags) {
// Unused on Android, which uses OnTextInputChanged instead.
}
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h
index e99bda7..9eecb6f 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.h
+++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -127,7 +127,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
virtual void SetIsLoading(bool is_loading) override;
virtual void TextInputTypeChanged(ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) override;
+ bool can_compose_inline,
+ int flags) override;
virtual void ImeCancelComposition() override;
virtual void FocusedNodeChanged(bool is_editable_node) override;
virtual void RenderProcessGone(base::TerminationStatus status,
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index a7eb8d6..4df2d63 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -441,6 +441,7 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host,
is_loading_(false),
text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT),
+ text_input_flags_(0),
can_compose_inline_(true),
has_composition_text_(false),
accept_return_character_(false),
@@ -860,13 +861,16 @@ void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) {
void RenderWidgetHostViewAura::TextInputTypeChanged(
ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) {
+ bool can_compose_inline,
+ int flags) {
if (text_input_type_ != type ||
text_input_mode_ != input_mode ||
- can_compose_inline_ != can_compose_inline) {
+ can_compose_inline_ != can_compose_inline ||
+ text_input_flags_ != flags) {
text_input_type_ = type;
text_input_mode_ = input_mode;
can_compose_inline_ = can_compose_inline;
+ text_input_flags_ = flags;
if (GetInputMethod())
GetInputMethod()->OnTextInputTypeChanged(this);
if (touch_editing_client_)
@@ -876,6 +880,7 @@ void RenderWidgetHostViewAura::TextInputTypeChanged(
void RenderWidgetHostViewAura::OnTextInputStateChanged(
const ViewHostMsg_TextInputState_Params& params) {
+ text_input_flags_ = params.flags;
if (params.show_ime_if_needed && params.type != ui::TEXT_INPUT_TYPE_NONE) {
if (GetInputMethod())
GetInputMethod()->ShowImeIfNeeded();
@@ -1461,6 +1466,10 @@ ui::TextInputMode RenderWidgetHostViewAura::GetTextInputMode() const {
return text_input_mode_;
}
+int RenderWidgetHostViewAura::GetTextInputFlags() const {
+ return text_input_flags_;
+}
+
bool RenderWidgetHostViewAura::CanComposeInline() const {
return can_compose_inline_;
}
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
index 0a6ba5f..92b4795 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.h
+++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -173,7 +173,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
virtual void SetIsLoading(bool is_loading) override;
virtual void TextInputTypeChanged(ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) override;
+ bool can_compose_inline,
+ int flags) override;
virtual void ImeCancelComposition() override;
virtual void ImeCompositionRangeChanged(
const gfx::Range& range,
@@ -247,6 +248,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
virtual gfx::NativeWindow GetAttachedWindow() const override;
virtual ui::TextInputType GetTextInputType() const override;
virtual ui::TextInputMode GetTextInputMode() const override;
+ virtual int GetTextInputFlags() const override;
virtual bool CanComposeInline() const override;
virtual gfx::Rect GetCaretBounds() const override;
virtual bool GetCompositionCharacterBounds(uint32 index,
@@ -527,6 +529,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
ui::TextInputType text_input_type_;
// The current text input mode corresponding to HTML5 inputmode attribute.
ui::TextInputMode text_input_mode_;
+ // The current text input flags.
+ int text_input_flags_;
bool can_compose_inline_;
// Rectangles for the selection anchor and focus.
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
index d30bc5d..5ce38ce 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -222,7 +222,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// Updates the type of the input method attached to the view.
virtual void TextInputTypeChanged(ui::TextInputType type,
ui::TextInputMode mode,
- bool can_compose_inline) = 0;
+ bool can_compose_inline,
+ int flags) = 0;
// Cancel the ongoing composition of the input method attached to the view.
virtual void ImeCancelComposition() = 0;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
index acab4f0..925212b 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -268,7 +268,8 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
void SetIsLoading(bool is_loading) override;
void TextInputTypeChanged(ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) override;
+ bool can_compose_inline,
+ int flags) override;
void ImeCancelComposition() override;
void ImeCompositionRangeChanged(
const gfx::Range& range,
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 324599f..ddd7a2a 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -944,7 +944,8 @@ void RenderWidgetHostViewMac::SetIsLoading(bool is_loading) {
void RenderWidgetHostViewMac::TextInputTypeChanged(
ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) {
+ bool can_compose_inline,
+ int flags) {
if (text_input_type_ != type
|| can_compose_inline_ != can_compose_inline) {
text_input_type_ = type;
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 8525421..3f55ab5 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -1375,10 +1375,11 @@ IPC_MESSAGE_ROUTED1(ViewHostMsg_TakeFocus,
IPC_MESSAGE_ROUTED1(ViewHostMsg_OpenDateTimeDialog,
ViewHostMsg_DateTimeDialogValue_Params /* value */)
-IPC_MESSAGE_ROUTED3(ViewHostMsg_TextInputTypeChanged,
+IPC_MESSAGE_ROUTED4(ViewHostMsg_TextInputTypeChanged,
ui::TextInputType /* TextInputType of the focused node */,
ui::TextInputMode /* TextInputMode of the focused node */,
- bool /* can_compose_inline in the focused node */)
+ bool /* can_compose_inline in the focused node */,
+ int /* flags in the focused node */)
// Required for updating text input state.
IPC_MESSAGE_ROUTED1(ViewHostMsg_TextInputStateChanged,
diff --git a/content/renderer/npapi/webplugin_delegate_proxy.cc b/content/renderer/npapi/webplugin_delegate_proxy.cc
index d64c3a0..3576b19 100644
--- a/content/renderer/npapi/webplugin_delegate_proxy.cc
+++ b/content/renderer/npapi/webplugin_delegate_proxy.cc
@@ -924,7 +924,7 @@ void WebPluginDelegateProxy::OnNotifyIMEStatus(int input_type,
render_view_->routing_id(),
static_cast<ui::TextInputType>(input_type),
ui::TEXT_INPUT_MODE_DEFAULT,
- true));
+ true, 0));
ViewHostMsg_SelectionBounds_Params bounds_params;
bounds_params.anchor_rect = bounds_params.focus_rect = caret_rect;
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 57b7abf..6d3cdcf 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -403,6 +403,7 @@ RenderWidget::RenderWidget(blink::WebPopupType popup_type,
input_method_is_active_(false),
text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT),
+ text_input_flags_(0),
can_compose_inline_(true),
popup_type_(popup_type),
pending_window_rect_count_(0),
@@ -1780,17 +1781,21 @@ void RenderWidget::UpdateTextInputType() {
if (webwidget_)
new_info = webwidget_->textInputInfo();
const ui::TextInputMode new_mode = ConvertInputMode(new_info.inputMode);
+ int new_flags = new_info.flags;
if (text_input_type_ != new_type
|| can_compose_inline_ != new_can_compose_inline
- || text_input_mode_ != new_mode) {
+ || text_input_mode_ != new_mode
+ || text_input_flags_ != new_flags) {
Send(new ViewHostMsg_TextInputTypeChanged(routing_id(),
new_type,
new_mode,
- new_can_compose_inline));
+ new_can_compose_inline,
+ new_flags));
text_input_type_ = new_type;
can_compose_inline_ = new_can_compose_inline;
text_input_mode_ = new_mode;
+ text_input_flags_ = new_flags;
}
}
@@ -1845,13 +1850,15 @@ void RenderWidget::UpdateTextInputState(ShowIme show_ime,
Send(new ViewHostMsg_TextInputTypeChanged(routing_id(),
new_type,
text_input_mode_,
- new_can_compose_inline));
+ new_can_compose_inline,
+ new_info.flags));
#endif
Send(new ViewHostMsg_TextInputStateChanged(routing_id(), p));
text_input_info_ = new_info;
text_input_type_ = new_type;
can_compose_inline_ = new_can_compose_inline;
+ text_input_flags_ = new_info.flags;
}
}
#endif
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index f9e7ea0..6b17db7 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -656,6 +656,9 @@ class CONTENT_EXPORT RenderWidget
// Stores the current text input mode of |webwidget_|.
ui::TextInputMode text_input_mode_;
+ // Stores the current text input flags of |webwidget_|.
+ int text_input_flags_;
+
// Stores the current type of composition text rendering of |webwidget_|.
bool can_compose_inline_;
diff --git a/content/test/test_render_view_host.h b/content/test/test_render_view_host.h
index 575d0bd..5d9d186 100644
--- a/content/test/test_render_view_host.h
+++ b/content/test/test_render_view_host.h
@@ -98,7 +98,8 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase {
void UpdateCursor(const WebCursor& cursor) override {}
void TextInputTypeChanged(ui::TextInputType type,
ui::TextInputMode input_mode,
- bool can_compose_inline) override {}
+ bool can_compose_inline,
+ int flags) override {}
void ImeCancelComposition() override {}
#if defined(OS_MACOSX) || defined(USE_AURA)
void ImeCompositionRangeChanged(
diff --git a/ui/base/ime/chromeos/ime_bridge.h b/ui/base/ime/chromeos/ime_bridge.h
index a4b5fef..ff7d4fa 100644
--- a/ui/base/ime/chromeos/ime_bridge.h
+++ b/ui/base/ime/chromeos/ime_bridge.h
@@ -50,8 +50,8 @@ class UI_BASE_EXPORT IMEEngineHandlerInterface {
// A type of each member is based on the html spec, but InputContext can be
// used to specify about a non html text field like Omnibox.
struct InputContext {
- InputContext(ui::TextInputType type_, ui::TextInputMode mode_) :
- type(type_), mode(mode_) {}
+ InputContext(ui::TextInputType type_, ui::TextInputMode mode_, int flags_) :
+ type(type_), mode(mode_), flags(flags_) {}
// An attribute of the field defined at
// http://www.w3.org/TR/html401/interact/forms.html#input-control-types.
@@ -61,6 +61,9 @@ class UI_BASE_EXPORT IMEEngineHandlerInterface {
// association-of-controls-and-forms.html#input-modalities
// :-the-inputmode-attribute.
ui::TextInputMode mode;
+ // An antribute to indicate the flags for web input fields. Please refer to
+ // WebTextInputType.
+ int flags;
};
virtual ~IMEEngineHandlerInterface() {}
diff --git a/ui/base/ime/chromeos/mock_ime_engine_handler.cc b/ui/base/ime/chromeos/mock_ime_engine_handler.cc
index ca855a0..bc0ff59 100644
--- a/ui/base/ime/chromeos/mock_ime_engine_handler.cc
+++ b/ui/base/ime/chromeos/mock_ime_engine_handler.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "ui/base/ime/chromeos/mock_ime_engine_handler.h"
+#include "ui/base/ime/text_input_flags.h"
namespace chromeos {
@@ -13,7 +14,8 @@ MockIMEEngineHandler::MockIMEEngineHandler()
process_key_event_call_count_(0),
reset_call_count_(0),
last_text_input_context_(ui::TEXT_INPUT_TYPE_NONE,
- ui::TEXT_INPUT_MODE_DEFAULT),
+ ui::TEXT_INPUT_MODE_DEFAULT,
+ ui::TEXT_INPUT_FLAG_NONE),
last_set_surrounding_cursor_pos_(0),
last_set_surrounding_anchor_pos_(0) {
}
diff --git a/ui/base/ime/dummy_input_method.cc b/ui/base/ime/dummy_input_method.cc
index a12bbfc..700e793 100644
--- a/ui/base/ime/dummy_input_method.cc
+++ b/ui/base/ime/dummy_input_method.cc
@@ -71,6 +71,10 @@ TextInputMode DummyInputMethod::GetTextInputMode() const {
return TEXT_INPUT_MODE_DEFAULT;
}
+int DummyInputMethod::GetTextInputFlags() const {
+ return 0;
+}
+
bool DummyInputMethod::CanComposeInline() const {
return true;
}
diff --git a/ui/base/ime/dummy_input_method.h b/ui/base/ime/dummy_input_method.h
index 20a019b..edad7b8 100644
--- a/ui/base/ime/dummy_input_method.h
+++ b/ui/base/ime/dummy_input_method.h
@@ -35,6 +35,7 @@ class DummyInputMethod : public InputMethod {
bool IsActive() override;
TextInputType GetTextInputType() const override;
TextInputMode GetTextInputMode() const override;
+ int GetTextInputFlags() const override;
bool CanComposeInline() const override;
bool IsCandidatePopupOpen() const override;
void ShowImeIfNeeded() override;
diff --git a/ui/base/ime/dummy_text_input_client.cc b/ui/base/ime/dummy_text_input_client.cc
index cea49c6..3adb420 100644
--- a/ui/base/ime/dummy_text_input_client.cc
+++ b/ui/base/ime/dummy_text_input_client.cc
@@ -44,6 +44,10 @@ TextInputMode DummyTextInputClient::GetTextInputMode() const {
return TEXT_INPUT_MODE_DEFAULT;
}
+int DummyTextInputClient::GetTextInputFlags() const {
+ return 0;
+}
+
bool DummyTextInputClient::CanComposeInline() const {
return false;
}
diff --git a/ui/base/ime/dummy_text_input_client.h b/ui/base/ime/dummy_text_input_client.h
index 898ffa2..32dd857 100644
--- a/ui/base/ime/dummy_text_input_client.h
+++ b/ui/base/ime/dummy_text_input_client.h
@@ -25,6 +25,7 @@ class DummyTextInputClient : public TextInputClient {
gfx::NativeWindow GetAttachedWindow() const override;
TextInputType GetTextInputType() const override;
TextInputMode GetTextInputMode() const override;
+ int GetTextInputFlags() const override;
bool CanComposeInline() const override;
gfx::Rect GetCaretBounds() const override;
bool GetCompositionCharacterBounds(uint32 index,
diff --git a/ui/base/ime/input_method.h b/ui/base/ime/input_method.h
index 462e0b0..164b1f1 100644
--- a/ui/base/ime/input_method.h
+++ b/ui/base/ime/input_method.h
@@ -146,6 +146,10 @@ class InputMethod {
// ui::TEXT_INPUT_TYPE_DEFAULT if there is no focused client.
virtual TextInputMode GetTextInputMode() const = 0;
+ // Gets the text input flags of the focused text input client. Returns
+ // 0 if there is no focused client.
+ virtual int GetTextInputFlags() const = 0;
+
// Checks if the focused text input client supports inline composition.
virtual bool CanComposeInline() const = 0;
diff --git a/ui/base/ime/input_method_base.cc b/ui/base/ime/input_method_base.cc
index ed34767..53a16d1 100644
--- a/ui/base/ime/input_method_base.cc
+++ b/ui/base/ime/input_method_base.cc
@@ -80,6 +80,11 @@ TextInputMode InputMethodBase::GetTextInputMode() const {
return client ? client->GetTextInputMode() : TEXT_INPUT_MODE_DEFAULT;
}
+int InputMethodBase::GetTextInputFlags() const {
+ TextInputClient* client = GetTextInputClient();
+ return client ? client->GetTextInputFlags() : 0;
+}
+
bool InputMethodBase::CanComposeInline() const {
TextInputClient* client = GetTextInputClient();
return client ? client->CanComposeInline() : true;
diff --git a/ui/base/ime/input_method_base.h b/ui/base/ime/input_method_base.h
index 8c6dd25..e388948 100644
--- a/ui/base/ime/input_method_base.h
+++ b/ui/base/ime/input_method_base.h
@@ -49,6 +49,7 @@ class UI_BASE_EXPORT InputMethodBase
TextInputType GetTextInputType() const override;
TextInputMode GetTextInputMode() const override;
+ int GetTextInputFlags() const override;
bool CanComposeInline() const override;
void ShowImeIfNeeded() override;
diff --git a/ui/base/ime/input_method_chromeos.cc b/ui/base/ime/input_method_chromeos.cc
index 6930968..d2ca6f0 100644
--- a/ui/base/ime/input_method_chromeos.cc
+++ b/ui/base/ime/input_method_chromeos.cc
@@ -167,7 +167,7 @@ void InputMethodChromeOS::OnTextInputTypeChanged(
// The focus in to or out from password field should also notify engine.
engine->FocusOut();
chromeos::IMEEngineHandlerInterface::InputContext context(
- GetTextInputType(), GetTextInputMode());
+ GetTextInputType(), GetTextInputMode(), GetTextInputFlags());
engine->FocusIn(context);
}
@@ -271,7 +271,7 @@ void InputMethodChromeOS::OnDidChangeFocusedClient(
if (GetEngine()) {
chromeos::IMEEngineHandlerInterface::InputContext context(
- GetTextInputType(), GetTextInputMode());
+ GetTextInputType(), GetTextInputMode(), GetTextInputFlags());
GetEngine()->FocusIn(context);
}
}
diff --git a/ui/base/ime/input_method_chromeos_unittest.cc b/ui/base/ime/input_method_chromeos_unittest.cc
index 5071872..3e7f20b 100644
--- a/ui/base/ime/input_method_chromeos_unittest.cc
+++ b/ui/base/ime/input_method_chromeos_unittest.cc
@@ -279,6 +279,9 @@ class InputMethodChromeOSTest : public internal::InputMethodDelegate,
virtual TextInputMode GetTextInputMode() const override {
return input_mode_;
}
+ virtual int GetTextInputFlags() const override {
+ return 0;
+ }
virtual bool CanComposeInline() const override {
return can_compose_inline_;
}
diff --git a/ui/base/ime/mock_input_method.cc b/ui/base/ime/mock_input_method.cc
index 5ffc76f..fb1e6ba 100644
--- a/ui/base/ime/mock_input_method.cc
+++ b/ui/base/ime/mock_input_method.cc
@@ -102,6 +102,10 @@ TextInputMode MockInputMethod::GetTextInputMode() const {
return TEXT_INPUT_MODE_DEFAULT;
}
+int MockInputMethod::GetTextInputFlags() const {
+ return 0;
+}
+
bool MockInputMethod::CanComposeInline() const {
return true;
}
diff --git a/ui/base/ime/mock_input_method.h b/ui/base/ime/mock_input_method.h
index 67a2029..b88787c 100644
--- a/ui/base/ime/mock_input_method.h
+++ b/ui/base/ime/mock_input_method.h
@@ -47,6 +47,7 @@ class UI_BASE_EXPORT MockInputMethod : NON_EXPORTED_BASE(public InputMethod) {
bool IsActive() override;
TextInputType GetTextInputType() const override;
TextInputMode GetTextInputMode() const override;
+ int GetTextInputFlags() const override;
bool CanComposeInline() const override;
bool IsCandidatePopupOpen() const override;
void ShowImeIfNeeded() override;
diff --git a/ui/base/ime/remote_input_method_win.cc b/ui/base/ime/remote_input_method_win.cc
index f74dcde..f3ed001 100644
--- a/ui/base/ime/remote_input_method_win.cc
+++ b/ui/base/ime/remote_input_method_win.cc
@@ -270,6 +270,11 @@ class RemoteInputMethodWin : public InputMethod,
: TEXT_INPUT_MODE_DEFAULT;
}
+ virtual int GetTextInputFlags() const override {
+ return text_input_client_ ? text_input_client_->GetTextInputFlags()
+ : 0;
+ }
+
virtual bool CanComposeInline() const override {
return text_input_client_ ? text_input_client_->CanComposeInline() : true;
}
diff --git a/ui/base/ime/text_input_client.h b/ui/base/ime/text_input_client.h
index ff1242f..582a0d3 100644
--- a/ui/base/ime/text_input_client.h
+++ b/ui/base/ime/text_input_client.h
@@ -68,6 +68,11 @@ class UI_BASE_EXPORT TextInputClient {
// TEXT_INPUT_MODE_DEFAULT at runtime.
virtual ui::TextInputMode GetTextInputMode() const = 0;
+ // Returns the current text input flags, which is a bit map of
+ // WebTextInputType defined in blink. This is valid only for web input fileds;
+ // it will return TEXT_INPUT_FLAG_NONE for native input fields.
+ virtual int GetTextInputFlags() const = 0;
+
// Returns if the client supports inline composition currently.
virtual bool CanComposeInline() const = 0;
diff --git a/ui/base/ime/text_input_flags.h b/ui/base/ime/text_input_flags.h
new file mode 100644
index 0000000..3e83a70
--- /dev/null
+++ b/ui/base/ime/text_input_flags.h
@@ -0,0 +1,24 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_BASE_IME_TEXT_INPUT_FLAGS_H_
+#define UI_BASE_IME_TEXT_INPUT_FLAGS_H_
+
+namespace ui {
+
+// Intentionally keep in sync with blink::WebTextInputFlags defined in:
+// third_party/WebKit/public/web/WebTextInputType.h
+enum TextInputFlags {
+ TEXT_INPUT_FLAG_NONE = 0,
+ TEXT_INPUT_FLAG_AUTOCOMPLETE_ON = 1 << 0,
+ TEXT_INPUT_FLAG_AUTOCOMPLETE_OFF = 1 << 1,
+ TEXT_INPUT_FLAG_AUTOCORRECT_ON = 1 << 2,
+ TEXT_INPUT_FLAG_AUTOCORRECT_OFF = 1 << 3,
+ TEXT_INPUT_FLAG_SPELLCHECK_ON = 1 << 4,
+ TEXT_INPUT_FLAG_SPELLCHECK_OFF = 1 << 5
+};
+
+} // namespace ui
+
+#endif // UI_BASE_IME_TEXT_INPUT_FLAGS_H_
diff --git a/ui/views/controls/prefix_selector.cc b/ui/views/controls/prefix_selector.cc
index c901edd..7e23aa9 100644
--- a/ui/views/controls/prefix_selector.cc
+++ b/ui/views/controls/prefix_selector.cc
@@ -67,6 +67,10 @@ ui::TextInputMode PrefixSelector::GetTextInputMode() const {
return ui::TEXT_INPUT_MODE_DEFAULT;
}
+int PrefixSelector::GetTextInputFlags() const {
+ return 0;
+}
+
bool PrefixSelector::CanComposeInline() const {
return false;
}
diff --git a/ui/views/controls/prefix_selector.h b/ui/views/controls/prefix_selector.h
index 615f239..8c40eda 100644
--- a/ui/views/controls/prefix_selector.h
+++ b/ui/views/controls/prefix_selector.h
@@ -34,6 +34,7 @@ class VIEWS_EXPORT PrefixSelector : public ui::TextInputClient {
virtual gfx::NativeWindow GetAttachedWindow() const override;
virtual ui::TextInputType GetTextInputType() const override;
virtual ui::TextInputMode GetTextInputMode() const override;
+ virtual int GetTextInputFlags() const override;
virtual bool CanComposeInline() const override;
virtual gfx::Rect GetCaretBounds() const override;
virtual bool GetCompositionCharacterBounds(uint32 index,
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index cd4c7e4..5a0cad8 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -1416,6 +1416,10 @@ ui::TextInputMode Textfield::GetTextInputMode() const {
return ui::TEXT_INPUT_MODE_DEFAULT;
}
+int Textfield::GetTextInputFlags() const {
+ return 0;
+}
+
bool Textfield::CanComposeInline() const {
return true;
}
diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h
index 53f0ee6..f84b07e 100644
--- a/ui/views/controls/textfield/textfield.h
+++ b/ui/views/controls/textfield/textfield.h
@@ -287,6 +287,7 @@ class VIEWS_EXPORT Textfield : public View,
virtual gfx::NativeWindow GetAttachedWindow() const override;
virtual ui::TextInputType GetTextInputType() const override;
virtual ui::TextInputMode GetTextInputMode() const override;
+ virtual int GetTextInputFlags() const override;
virtual bool CanComposeInline() const override;
virtual gfx::Rect GetCaretBounds() const override;
virtual bool GetCompositionCharacterBounds(uint32 index,
diff --git a/ui/views/ime/input_method_bridge.cc b/ui/views/ime/input_method_bridge.cc
index 8e321f0..92f886e 100644
--- a/ui/views/ime/input_method_bridge.cc
+++ b/ui/views/ime/input_method_bridge.cc
@@ -226,6 +226,11 @@ ui::TextInputMode InputMethodBridge::GetTextInputMode() const {
return client ? client->GetTextInputMode() : ui::TEXT_INPUT_MODE_DEFAULT;
}
+int InputMethodBridge::GetTextInputFlags() const {
+ TextInputClient* client = GetTextInputClient();
+ return client ? client->GetTextInputFlags() : 0;
+}
+
bool InputMethodBridge::CanComposeInline() const {
TextInputClient* client = GetTextInputClient();
return client ? client->CanComposeInline() : true;
diff --git a/ui/views/ime/input_method_bridge.h b/ui/views/ime/input_method_bridge.h
index 43fb947..8813e87 100644
--- a/ui/views/ime/input_method_bridge.h
+++ b/ui/views/ime/input_method_bridge.h
@@ -59,6 +59,7 @@ class InputMethodBridge : public InputMethodBase,
virtual gfx::NativeWindow GetAttachedWindow() const override;
virtual ui::TextInputType GetTextInputType() const override;
virtual ui::TextInputMode GetTextInputMode() const override;
+ virtual int GetTextInputFlags() const override;
virtual bool CanComposeInline() const override;
virtual gfx::Rect GetCaretBounds() const override;
virtual bool GetCompositionCharacterBounds(uint32 index,