OLD | NEW |
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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 inline Editor& InputMethodController::GetEditor() const { | 295 inline Editor& InputMethodController::GetEditor() const { |
296 return GetFrame().GetEditor(); | 296 return GetFrame().GetEditor(); |
297 } | 297 } |
298 | 298 |
299 void InputMethodController::Clear() { | 299 void InputMethodController::Clear() { |
300 has_composition_ = false; | 300 has_composition_ = false; |
301 if (composition_range_) { | 301 if (composition_range_) { |
302 composition_range_->setStart(&GetDocument(), 0); | 302 composition_range_->setStart(&GetDocument(), 0); |
303 composition_range_->collapse(true); | 303 composition_range_->collapse(true); |
304 } | 304 } |
305 GetDocument().Markers().RemoveMarkers(DocumentMarker::kComposition); | 305 GetDocument().Markers().RemoveMarkersOfTypes(DocumentMarker::kComposition); |
306 } | 306 } |
307 | 307 |
308 void InputMethodController::ContextDestroyed(Document*) { | 308 void InputMethodController::ContextDestroyed(Document*) { |
309 Clear(); | 309 Clear(); |
310 composition_range_ = nullptr; | 310 composition_range_ = nullptr; |
311 } | 311 } |
312 | 312 |
313 void InputMethodController::DocumentAttached(Document* document) { | 313 void InputMethodController::DocumentAttached(Document* document) { |
314 DCHECK(document); | 314 DCHECK(document); |
315 SetContext(document); | 315 SetContext(document); |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 FinishComposingText(kKeepSelection); | 1230 FinishComposingText(kKeepSelection); |
1231 } | 1231 } |
1232 | 1232 |
1233 DEFINE_TRACE(InputMethodController) { | 1233 DEFINE_TRACE(InputMethodController) { |
1234 visitor->Trace(frame_); | 1234 visitor->Trace(frame_); |
1235 visitor->Trace(composition_range_); | 1235 visitor->Trace(composition_range_); |
1236 SynchronousMutationObserver::Trace(visitor); | 1236 SynchronousMutationObserver::Trace(visitor); |
1237 } | 1237 } |
1238 | 1238 |
1239 } // namespace blink | 1239 } // namespace blink |
OLD | NEW |