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

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: Fixed the build break by replacing WebViewImpl object with WebViewBase 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 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 flags |= kWebTextInputFlagAutocapitalizeCharacters; 1128 flags |= kWebTextInputFlagAutocapitalizeCharacters;
1127 else if (autocapitalize == words) 1129 else if (autocapitalize == words)
1128 flags |= kWebTextInputFlagAutocapitalizeWords; 1130 flags |= kWebTextInputFlagAutocapitalizeWords;
1129 else if (autocapitalize == sentences) 1131 else if (autocapitalize == sentences)
1130 flags |= kWebTextInputFlagAutocapitalizeSentences; 1132 flags |= kWebTextInputFlagAutocapitalizeSentences;
1131 else 1133 else
1132 NOTREACHED(); 1134 NOTREACHED();
1133 } 1135 }
1134 } 1136 }
1135 1137
1138 if (GetDocument().GetPage()->GetFocusController().NextFocusableElementInForm(
1139 element, kWebFocusTypeForward))
1140 flags |= kWebTextInputFlagHaveNextFocusableElement;
1141
1142 if (GetDocument().GetPage()->GetFocusController().NextFocusableElementInForm(
1143 element, kWebFocusTypeBackward))
1144 flags |= kWebTextInputFlagHavePreviousFocusableElement;
1145
1136 return flags; 1146 return flags;
1137 } 1147 }
1138 1148
1139 WebTextInputMode InputMethodController::InputModeOfFocusedElement() const { 1149 WebTextInputMode InputMethodController::InputModeOfFocusedElement() const {
1140 if (!RuntimeEnabledFeatures::inputModeAttributeEnabled()) 1150 if (!RuntimeEnabledFeatures::inputModeAttributeEnabled())
1141 return kWebTextInputModeDefault; 1151 return kWebTextInputModeDefault;
1142 1152
1143 AtomicString mode = GetInputModeAttribute(GetDocument().FocusedElement()); 1153 AtomicString mode = GetInputModeAttribute(GetDocument().FocusedElement());
1144 1154
1145 if (mode.IsEmpty()) 1155 if (mode.IsEmpty())
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 FinishComposingText(kKeepSelection); 1247 FinishComposingText(kKeepSelection);
1238 } 1248 }
1239 1249
1240 DEFINE_TRACE(InputMethodController) { 1250 DEFINE_TRACE(InputMethodController) {
1241 visitor->Trace(frame_); 1251 visitor->Trace(frame_);
1242 visitor->Trace(composition_range_); 1252 visitor->Trace(composition_range_);
1243 SynchronousMutationObserver::Trace(visitor); 1253 SynchronousMutationObserver::Trace(visitor);
1244 } 1254 }
1245 1255
1246 } // namespace blink 1256 } // namespace blink
OLDNEW
« no previous file with comments | « content/test/data/android/input/input_forms.html ('k') | third_party/WebKit/Source/core/page/FocusController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698