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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 #define EDIT_DEBUG 0 | 85 #define EDIT_DEBUG 0 |
86 | 86 |
87 namespace blink { | 87 namespace blink { |
88 | 88 |
89 using namespace HTMLNames; | 89 using namespace HTMLNames; |
90 | 90 |
91 static inline bool shouldAlwaysUseDirectionalSelection(LocalFrame* frame) { | 91 static inline bool shouldAlwaysUseDirectionalSelection(LocalFrame* frame) { |
92 return frame->editor().behavior().shouldConsiderSelectionAsDirectional(); | 92 return frame->editor().behavior().shouldConsiderSelectionAsDirectional(); |
93 } | 93 } |
94 | 94 |
95 FrameSelection::FrameSelection(LocalFrame* frame) | 95 FrameSelection::FrameSelection(LocalFrame& frame) |
96 : m_frame(frame), | 96 : m_frame(frame), |
97 m_pendingSelection(PendingSelection::create(*this)), | 97 m_pendingSelection(PendingSelection::create(*this)), |
98 m_selectionEditor(SelectionEditor::create(frame)), | 98 m_selectionEditor(SelectionEditor::create(frame)), |
99 m_granularity(CharacterGranularity), | 99 m_granularity(CharacterGranularity), |
100 m_xPosForVerticalArrowNavigation(NoXPosForVerticalArrowNavigation()), | 100 m_xPosForVerticalArrowNavigation(NoXPosForVerticalArrowNavigation()), |
101 m_focused(frame->page() && | 101 m_focused(frame.page() && |
102 frame->page()->focusController().focusedFrame() == frame), | 102 frame.page()->focusController().focusedFrame() == frame), |
103 m_frameCaret(new FrameCaret(frame, *m_selectionEditor)) { | 103 m_frameCaret(new FrameCaret(frame, *m_selectionEditor)) {} |
104 DCHECK(frame); | |
105 } | |
106 | 104 |
107 FrameSelection::~FrameSelection() {} | 105 FrameSelection::~FrameSelection() {} |
108 | 106 |
109 const Document& FrameSelection::document() const { | 107 const Document& FrameSelection::document() const { |
110 DCHECK(m_document); | 108 DCHECK(m_document); |
111 return *m_document; | 109 return *m_document; |
112 } | 110 } |
113 | 111 |
114 Document& FrameSelection::document() { | 112 Document& FrameSelection::document() { |
115 DCHECK(m_document); | 113 DCHECK(m_document); |
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 } | 1404 } |
1407 | 1405 |
1408 void showTree(const blink::FrameSelection* sel) { | 1406 void showTree(const blink::FrameSelection* sel) { |
1409 if (sel) | 1407 if (sel) |
1410 sel->showTreeForThis(); | 1408 sel->showTreeForThis(); |
1411 else | 1409 else |
1412 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; | 1410 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; |
1413 } | 1411 } |
1414 | 1412 |
1415 #endif | 1413 #endif |
OLD | NEW |