| 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 26 matching lines...) Expand all Loading... |
| 37 #include "core/editing/TypingCommand.h" | 37 #include "core/editing/TypingCommand.h" |
| 38 #include "core/html/HTMLTextAreaElement.h" | 38 #include "core/html/HTMLTextAreaElement.h" |
| 39 #include "core/page/EditorClient.h" | 39 #include "core/page/EditorClient.h" |
| 40 #include "core/page/EventHandler.h" | 40 #include "core/page/EventHandler.h" |
| 41 #include "core/page/Frame.h" | 41 #include "core/page/Frame.h" |
| 42 #include "core/rendering/RenderObject.h" | 42 #include "core/rendering/RenderObject.h" |
| 43 | 43 |
| 44 namespace WebCore { | 44 namespace WebCore { |
| 45 | 45 |
| 46 PlainTextOffsets::PlainTextOffsets() | 46 PlainTextOffsets::PlainTextOffsets() |
| 47 : m_start(notFound) | 47 : m_start(kNotFound) |
| 48 , m_end(notFound) | 48 , m_end(kNotFound) |
| 49 { | 49 { |
| 50 } | 50 } |
| 51 | 51 |
| 52 PlainTextOffsets::PlainTextOffsets(int start, int end) | 52 PlainTextOffsets::PlainTextOffsets(int start, int end) |
| 53 : m_start(start) | 53 : m_start(start) |
| 54 , m_end(end) | 54 , m_end(end) |
| 55 { | 55 { |
| 56 ASSERT(start != notFound); | 56 ASSERT(start != kNotFound); |
| 57 ASSERT(end != notFound); | 57 ASSERT(end != kNotFound); |
| 58 ASSERT(start <= end); | 58 ASSERT(start <= end); |
| 59 } | 59 } |
| 60 | 60 |
| 61 // ---------------------------- | 61 // ---------------------------- |
| 62 | 62 |
| 63 InputMethodController::SelectionOffsetsScope::SelectionOffsetsScope(InputMethodC
ontroller* inputMethodController) | 63 InputMethodController::SelectionOffsetsScope::SelectionOffsetsScope(InputMethodC
ontroller* inputMethodController) |
| 64 : m_inputMethodController(inputMethodController) | 64 : m_inputMethodController(inputMethodController) |
| 65 , m_offsets(inputMethodController->getSelectionOffsets()) | 65 , m_offsets(inputMethodController->getSelectionOffsets()) |
| 66 { | 66 { |
| 67 } | 67 } |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 375 |
| 376 bool InputMethodController::setSelectionOffsets(const PlainTextOffsets& selectio
nOffsets) | 376 bool InputMethodController::setSelectionOffsets(const PlainTextOffsets& selectio
nOffsets) |
| 377 { | 377 { |
| 378 if (selectionOffsets.isNull()) | 378 if (selectionOffsets.isNull()) |
| 379 return false; | 379 return false; |
| 380 // FIXME: We should move Editor::setSelectionOffsets() into InputMethodContr
oller class. | 380 // FIXME: We should move Editor::setSelectionOffsets() into InputMethodContr
oller class. |
| 381 return editor().setSelectionOffsets(selectionOffsets.start(), selectionOffse
ts.end()); | 381 return editor().setSelectionOffsets(selectionOffsets.start(), selectionOffse
ts.end()); |
| 382 } | 382 } |
| 383 | 383 |
| 384 } // namespace WebCore | 384 } // namespace WebCore |
| OLD | NEW |