| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 SetSelectionOptions options, | 298 SetSelectionOptions options, |
| 299 CursorAlignOnScroll align, | 299 CursorAlignOnScroll align, |
| 300 TextGranularity granularity) { | 300 TextGranularity granularity) { |
| 301 new_selection.AssertValidFor(GetDocument()); | 301 new_selection.AssertValidFor(GetDocument()); |
| 302 SelectionInDOMTree::Builder builder; | 302 SelectionInDOMTree::Builder builder; |
| 303 builder.SetAffinity(new_selection.Affinity()) | 303 builder.SetAffinity(new_selection.Affinity()) |
| 304 .SetBaseAndExtent(ToPositionInDOMTree(new_selection.Base()), | 304 .SetBaseAndExtent(ToPositionInDOMTree(new_selection.Base()), |
| 305 ToPositionInDOMTree(new_selection.Extent())) | 305 ToPositionInDOMTree(new_selection.Extent())) |
| 306 .SetGranularity(new_selection.Granularity()) | 306 .SetGranularity(new_selection.Granularity()) |
| 307 .SetIsDirectional(new_selection.IsDirectional()) | 307 .SetIsDirectional(new_selection.IsDirectional()) |
| 308 .SetIsHandleVisible(new_selection.IsHandleVisible()) | 308 .SetIsHandleVisible(new_selection.IsHandleVisible()); |
| 309 .SetHasTrailingWhitespace(new_selection.HasTrailingWhitespace()); | |
| 310 return SetSelection(builder.Build(), options, align, granularity); | 309 return SetSelection(builder.Build(), options, align, granularity); |
| 311 } | 310 } |
| 312 | 311 |
| 313 void FrameSelection::NodeChildrenWillBeRemoved(ContainerNode& container) { | 312 void FrameSelection::NodeChildrenWillBeRemoved(ContainerNode& container) { |
| 314 if (!container.InActiveDocument()) | 313 if (!container.InActiveDocument()) |
| 315 return; | 314 return; |
| 316 // TODO(yosin): We should move to call |TypingCommand::closeTyping()| to | 315 // TODO(yosin): We should move to call |TypingCommand::closeTyping()| to |
| 317 // |Editor| class. | 316 // |Editor| class. |
| 318 if (!GetDocument().IsRunningExecCommand()) | 317 if (!GetDocument().IsRunningExecCommand()) |
| 319 TypingCommand::CloseTyping(frame_); | 318 TypingCommand::CloseTyping(frame_); |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1182 } | 1181 } |
| 1183 | 1182 |
| 1184 void showTree(const blink::FrameSelection* sel) { | 1183 void showTree(const blink::FrameSelection* sel) { |
| 1185 if (sel) | 1184 if (sel) |
| 1186 sel->ShowTreeForThis(); | 1185 sel->ShowTreeForThis(); |
| 1187 else | 1186 else |
| 1188 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; | 1187 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; |
| 1189 } | 1188 } |
| 1190 | 1189 |
| 1191 #endif | 1190 #endif |
| OLD | NEW |