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

Side by Side Diff: sky/engine/core/html/ime/InputMethodContext.cpp

Issue 698213002: Remove lots of Text APIs. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/html/ime/InputMethodContext.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 bool InputMethodContext::hasFocus() const 88 bool InputMethodContext::hasFocus() const
89 { 89 {
90 LocalFrame* frame = m_element->document().frame(); 90 LocalFrame* frame = m_element->document().frame();
91 if (!frame) 91 if (!frame)
92 return false; 92 return false;
93 93
94 const Element* element = frame->document()->focusedElement(); 94 const Element* element = frame->document()->focusedElement();
95 return element && element->isHTMLElement() && m_element == toHTMLElement(ele ment); 95 return element && element->isHTMLElement() && m_element == toHTMLElement(ele ment);
96 } 96 }
97 97
98 String InputMethodContext::compositionText() const
ojan 2014/11/04 05:54:53 I'm a little surprised this is dead code. Is all o
99 {
100 if (!hasFocus())
101 return emptyString();
102
103 Text* text = inputMethodController().compositionNode();
104 return text ? text->wholeText() : emptyString();
105 }
106
107 CompositionUnderline InputMethodContext::selectedSegment() const 98 CompositionUnderline InputMethodContext::selectedSegment() const
108 { 99 {
109 CompositionUnderline underline; 100 CompositionUnderline underline;
110 if (!hasFocus()) 101 if (!hasFocus())
111 return underline; 102 return underline;
112 103
113 const InputMethodController& controller = inputMethodController(); 104 const InputMethodController& controller = inputMethodController();
114 if (!controller.hasComposition()) 105 if (!controller.hasComposition())
115 return underline; 106 return underline;
116 107
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 dispatchEvent(Event::create(EventTypeNames::candidatewindowhide)); 178 dispatchEvent(Event::create(EventTypeNames::candidatewindowhide));
188 } 179 }
189 180
190 void InputMethodContext::trace(Visitor* visitor) 181 void InputMethodContext::trace(Visitor* visitor)
191 { 182 {
192 visitor->trace(m_element); 183 visitor->trace(m_element);
193 EventTargetWithInlineData::trace(visitor); 184 EventTargetWithInlineData::trace(visitor);
194 } 185 }
195 186
196 } // namespace blink 187 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/html/ime/InputMethodContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698