| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Simon Hausmann <hausmann@kde.org> | 5 * 2000 Simon Hausmann <hausmann@kde.org> |
| 6 * 2000 Stefan Schimanski <1Stein@gmx.de> | 6 * 2000 Stefan Schimanski <1Stein@gmx.de> |
| 7 * 2001 George Staikos <staikos@kde.org> | 7 * 2001 George Staikos <staikos@kde.org> |
| 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
| 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 , m_deprecatedLoader(this) | 67 , m_deprecatedLoader(this) |
| 68 , m_mojoLoader(adoptPtr(new MojoLoader(*this))) | 68 , m_mojoLoader(adoptPtr(new MojoLoader(*this))) |
| 69 , m_dart(adoptPtr(new DartController())) | 69 , m_dart(adoptPtr(new DartController())) |
| 70 , m_editor(Editor::create(*this)) | 70 , m_editor(Editor::create(*this)) |
| 71 , m_spellChecker(SpellChecker::create(*this)) | 71 , m_spellChecker(SpellChecker::create(*this)) |
| 72 , m_selection(FrameSelection::create(this)) | 72 , m_selection(FrameSelection::create(this)) |
| 73 , m_eventHandler(adoptPtr(new EventHandler(this))) | 73 , m_eventHandler(adoptPtr(new EventHandler(this))) |
| 74 , m_newEventHandler(adoptPtr(new NewEventHandler(*this))) | 74 , m_newEventHandler(adoptPtr(new NewEventHandler(*this))) |
| 75 , m_console(FrameConsole::create(*this)) | 75 , m_console(FrameConsole::create(*this)) |
| 76 , m_inputMethodController(InputMethodController::create(*this)) | 76 , m_inputMethodController(InputMethodController::create(*this)) |
| 77 , m_document(nullptr) |
| 77 { | 78 { |
| 78 page()->setMainFrame(this); | 79 if (page()) |
| 80 page()->setMainFrame(this); |
| 79 } | 81 } |
| 80 | 82 |
| 81 PassRefPtr<LocalFrame> LocalFrame::create(FrameLoaderClient* client, FrameHost*
host) | 83 PassRefPtr<LocalFrame> LocalFrame::create(FrameLoaderClient* client, FrameHost*
host) |
| 82 { | 84 { |
| 83 return adoptRef(new LocalFrame(client, host)); | 85 return adoptRef(new LocalFrame(client, host)); |
| 84 } | 86 } |
| 85 | 87 |
| 86 LocalFrame::~LocalFrame() | 88 LocalFrame::~LocalFrame() |
| 87 { | 89 { |
| 88 setView(nullptr); | 90 setView(nullptr); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 if (visiblePos.isNull()) | 230 if (visiblePos.isNull()) |
| 229 visiblePos = VisiblePosition(firstPositionInOrBeforeNode(node)); | 231 visiblePos = VisiblePosition(firstPositionInOrBeforeNode(node)); |
| 230 return visiblePos; | 232 return visiblePos; |
| 231 } | 233 } |
| 232 | 234 |
| 233 RenderView* LocalFrame::contentRenderer() const | 235 RenderView* LocalFrame::contentRenderer() const |
| 234 { | 236 { |
| 235 return document() ? document()->renderView() : 0; | 237 return document() ? document()->renderView() : 0; |
| 236 } | 238 } |
| 237 | 239 |
| 240 void LocalFrame::setDocument(Document* document) |
| 241 { |
| 242 m_document = document; |
| 243 } |
| 244 |
| 238 Document* LocalFrame::document() const | 245 Document* LocalFrame::document() const |
| 239 { | 246 { |
| 247 if (m_document) |
| 248 return m_document; |
| 240 return m_domWindow ? m_domWindow->document() : 0; | 249 return m_domWindow ? m_domWindow->document() : 0; |
| 241 } | 250 } |
| 242 | 251 |
| 243 Document* LocalFrame::documentAtPoint(const IntPoint& point) | 252 Document* LocalFrame::documentAtPoint(const IntPoint& point) |
| 244 { | 253 { |
| 245 if (!view()) | 254 if (!view()) |
| 246 return 0; | 255 return 0; |
| 247 | 256 |
| 248 IntPoint pt = view()->windowToContents(point); | 257 IntPoint pt = view()->windowToContents(point); |
| 249 HitTestResult result = HitTestResult(pt); | 258 HitTestResult result = HitTestResult(pt); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 273 if (rect.contains(framePoint)) | 282 if (rect.contains(framePoint)) |
| 274 return nextCharacterRange.release(); | 283 return nextCharacterRange.release(); |
| 275 } | 284 } |
| 276 | 285 |
| 277 return nullptr; | 286 return nullptr; |
| 278 } | 287 } |
| 279 | 288 |
| 280 void LocalFrame::createView(const IntSize& viewportSize, const Color& background
Color, bool transparent) | 289 void LocalFrame::createView(const IntSize& viewportSize, const Color& background
Color, bool transparent) |
| 281 { | 290 { |
| 282 ASSERT(this); | 291 ASSERT(this); |
| 283 ASSERT(page()); | |
| 284 | 292 |
| 285 setView(nullptr); | 293 setView(nullptr); |
| 286 | 294 |
| 287 RefPtr<FrameView> frameView; | 295 RefPtr<FrameView> frameView; |
| 288 frameView = FrameView::create(this, viewportSize); | 296 frameView = FrameView::create(this, viewportSize); |
| 289 | 297 |
| 290 // The layout size is set by WebViewImpl to support @viewport | 298 // The layout size is set by WebViewImpl to support @viewport |
| 291 frameView->setLayoutSizeFixedToFrameSize(false); | 299 frameView->setLayoutSizeFixedToFrameSize(false); |
| 292 | 300 |
| 293 setView(frameView); | 301 setView(frameView); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 306 } | 314 } |
| 307 | 315 |
| 308 double LocalFrame::devicePixelRatio() const | 316 double LocalFrame::devicePixelRatio() const |
| 309 { | 317 { |
| 310 if (!m_host) | 318 if (!m_host) |
| 311 return 0; | 319 return 0; |
| 312 return m_host->deviceScaleFactor(); | 320 return m_host->deviceScaleFactor(); |
| 313 } | 321 } |
| 314 | 322 |
| 315 } // namespace blink | 323 } // namespace blink |
| OLD | NEW |