summaryrefslogtreecommitdiffstats
path: root/chrome/common/webkit_param_traits.h
diff options
context:
space:
mode:
authorsuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 17:53:04 +0000
committersuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 17:53:04 +0000
commitfa7b1dc866e2a5af457602e015ebc84ab05c75b9 (patch)
treee0226343303b9925c10deba260ed00e7f91aa8dd /chrome/common/webkit_param_traits.h
parent31825d4399cf8c44f86f828f5662c885c85e8b49 (diff)
downloadchromium_src-fa7b1dc866e2a5af457602e015ebc84ab05c75b9.zip
chromium_src-fa7b1dc866e2a5af457602e015ebc84ab05c75b9.tar.gz
chromium_src-fa7b1dc866e2a5af457602e015ebc84ab05c75b9.tar.bz2
Improve input method support.
This CL fixes following issues: BUG=23219 IME should be disabled in password box. BUG=41876 Chinese IME is still active when current focus is not a text input control BUG=44529 Clause segmentation information of composition text is not honored when using CJK input methods. BUG=46326 Clicking during a composition cancels it TEST=See individual bug report. This CL is blocked on webkit bug: https://bugs.webkit.org/show_bug.cgi?id=40608 Review URL: http://codereview.chromium.org/2824015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50622 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/webkit_param_traits.h')
-rw-r--r--chrome/common/webkit_param_traits.h86
1 files changed, 66 insertions, 20 deletions
diff --git a/chrome/common/webkit_param_traits.h b/chrome/common/webkit_param_traits.h
index 270c2f7..e277e38 100644
--- a/chrome/common/webkit_param_traits.h
+++ b/chrome/common/webkit_param_traits.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// Copyright (c) 2010 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.
//
@@ -25,7 +25,7 @@
#include "ipc/ipc_message_utils.h"
#include "third_party/WebKit/WebKit/chromium/public/WebCache.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebCompositionCommand.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h"
#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h"
#include "third_party/WebKit/WebKit/chromium/public/WebContextMenuData.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDragOperation.h"
@@ -35,6 +35,7 @@
#include "third_party/WebKit/WebKit/chromium/public/WebPopupType.h"
#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h"
#include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebTextInputType.h"
namespace IPC {
@@ -101,24 +102,6 @@ struct ParamTraits<WebKit::WebScreenInfo> {
};
template <>
-struct ParamTraits<WebKit::WebCompositionCommand> {
- typedef WebKit::WebCompositionCommand param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, static_cast<int>(p));
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- int value;
- if (!ReadParam(m, iter, &value))
- return false;
- *r = static_cast<param_type>(value);
- return true;
- }
- static void Log(const param_type& p, std::wstring* l) {
- LogParam(static_cast<int>(p), l);
- }
-};
-
-template <>
struct ParamTraits<WebKit::WebConsoleMessage::Level> {
typedef WebKit::WebConsoleMessage::Level param_type;
static void Write(Message* m, const param_type& p) {
@@ -391,6 +374,69 @@ template <>
}
};
+template <>
+struct ParamTraits<WebKit::WebCompositionUnderline> {
+ typedef WebKit::WebCompositionUnderline param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.startOffset);
+ WriteParam(m, p.endOffset);
+ WriteParam(m, p.color);
+ WriteParam(m, p.thick);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->startOffset) &&
+ ReadParam(m, iter, &p->endOffset) &&
+ ReadParam(m, iter, &p->color) &&
+ ReadParam(m, iter, &p->thick);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.startOffset, l);
+ l->append(L",");
+ LogParam(p.endOffset, l);
+ l->append(L":");
+ LogParam(p.color, l);
+ l->append(L":");
+ LogParam(p.thick, l);
+ l->append(L")");
+ }
+};
+
+template <>
+struct ParamTraits<WebKit::WebTextInputType> {
+ typedef WebKit::WebTextInputType param_type;
+ static void Write(Message* m, const param_type& p) {
+ m->WriteInt(p);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ int type;
+ if (!m->ReadInt(iter, &type))
+ return false;
+ *p = static_cast<param_type>(type);
+ return true;
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ std::wstring control;
+ switch (p) {
+ case WebKit::WebTextInputTypeNone:
+ control = L"WebKit::WebTextInputTypeNone";
+ break;
+ case WebKit::WebTextInputTypeText:
+ control = L"WebKit::WebTextInputTypeText";
+ break;
+ case WebKit::WebTextInputTypePassword:
+ control = L"WebKit::WebTextInputTypePassword";
+ break;
+ default:
+ NOTIMPLEMENTED();
+ control = L"UNKNOWN";
+ break;
+ }
+ LogParam(control, l);
+ }
+};
+
} // namespace IPC
#endif // CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_