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

Side by Side Diff: third_party/WebKit/Source/core/editing/InputMethodController.cpp

Issue 2839993002: [Android] Adding Smart GO/NEXT feature in Chrome (Closed)
Patch Set: Added inputType check in ImeTest Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 27 matching lines...) Expand all
38 #include "core/editing/state_machines/BackwardCodePointStateMachine.h" 38 #include "core/editing/state_machines/BackwardCodePointStateMachine.h"
39 #include "core/editing/state_machines/ForwardCodePointStateMachine.h" 39 #include "core/editing/state_machines/ForwardCodePointStateMachine.h"
40 #include "core/events/CompositionEvent.h" 40 #include "core/events/CompositionEvent.h"
41 #include "core/frame/LocalFrame.h" 41 #include "core/frame/LocalFrame.h"
42 #include "core/html/HTMLInputElement.h" 42 #include "core/html/HTMLInputElement.h"
43 #include "core/html/HTMLTextAreaElement.h" 43 #include "core/html/HTMLTextAreaElement.h"
44 #include "core/input/EventHandler.h" 44 #include "core/input/EventHandler.h"
45 #include "core/layout/LayoutObject.h" 45 #include "core/layout/LayoutObject.h"
46 #include "core/layout/LayoutTheme.h" 46 #include "core/layout/LayoutTheme.h"
47 #include "core/page/ChromeClient.h" 47 #include "core/page/ChromeClient.h"
48 #include "core/page/FocusController.h"
49 #include "core/page/Page.h"
48 50
49 namespace blink { 51 namespace blink {
50 52
51 namespace { 53 namespace {
52 54
53 void DispatchCompositionUpdateEvent(LocalFrame& frame, const String& text) { 55 void DispatchCompositionUpdateEvent(LocalFrame& frame, const String& text) {
54 Element* target = frame.GetDocument()->FocusedElement(); 56 Element* target = frame.GetDocument()->FocusedElement();
55 if (!target) 57 if (!target)
56 return; 58 return;
57 59
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 flags |= kWebTextInputFlagAutocapitalizeCharacters; 1138 flags |= kWebTextInputFlagAutocapitalizeCharacters;
1137 else if (autocapitalize == words) 1139 else if (autocapitalize == words)
1138 flags |= kWebTextInputFlagAutocapitalizeWords; 1140 flags |= kWebTextInputFlagAutocapitalizeWords;
1139 else if (autocapitalize == sentences) 1141 else if (autocapitalize == sentences)
1140 flags |= kWebTextInputFlagAutocapitalizeSentences; 1142 flags |= kWebTextInputFlagAutocapitalizeSentences;
1141 else 1143 else
1142 NOTREACHED(); 1144 NOTREACHED();
1143 } 1145 }
1144 } 1146 }
1145 1147
1148 if (GetDocument().GetPage()->GetFocusController().NextFocusableElementInForm(
1149 element, kWebFocusTypeForward))
1150 flags |= kWebTextInputFlagHaveNextFocusableElement;
1151
1152 if (GetDocument().GetPage()->GetFocusController().NextFocusableElementInForm(
1153 element, kWebFocusTypeBackward))
1154 flags |= kWebTextInputFlagHavePreviousFocusableElement;
1155
1146 return flags; 1156 return flags;
1147 } 1157 }
1148 1158
1149 WebTextInputMode InputMethodController::InputModeOfFocusedElement() const { 1159 WebTextInputMode InputMethodController::InputModeOfFocusedElement() const {
1150 if (!RuntimeEnabledFeatures::inputModeAttributeEnabled()) 1160 if (!RuntimeEnabledFeatures::inputModeAttributeEnabled())
1151 return kWebTextInputModeDefault; 1161 return kWebTextInputModeDefault;
1152 1162
1153 AtomicString mode = GetInputModeAttribute(GetDocument().FocusedElement()); 1163 AtomicString mode = GetInputModeAttribute(GetDocument().FocusedElement());
1154 1164
1155 if (mode.IsEmpty()) 1165 if (mode.IsEmpty())
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 FinishComposingText(kKeepSelection); 1257 FinishComposingText(kKeepSelection);
1248 } 1258 }
1249 1259
1250 DEFINE_TRACE(InputMethodController) { 1260 DEFINE_TRACE(InputMethodController) {
1251 visitor->Trace(frame_); 1261 visitor->Trace(frame_);
1252 visitor->Trace(composition_range_); 1262 visitor->Trace(composition_range_);
1253 SynchronousMutationObserver::Trace(visitor); 1263 SynchronousMutationObserver::Trace(visitor);
1254 } 1264 }
1255 1265
1256 } // namespace blink 1266 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698