| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 : Frame(client, host) | 70 : Frame(client, host) |
| 71 , m_deprecatedLoader(this) | 71 , m_deprecatedLoader(this) |
| 72 , m_mojoLoader(adoptPtr(new MojoLoader(*this))) | 72 , m_mojoLoader(adoptPtr(new MojoLoader(*this))) |
| 73 , m_script(adoptPtr(new ScriptController(this))) | 73 , m_script(adoptPtr(new ScriptController(this))) |
| 74 , m_editor(Editor::create(*this)) | 74 , m_editor(Editor::create(*this)) |
| 75 , m_spellChecker(SpellChecker::create(*this)) | 75 , m_spellChecker(SpellChecker::create(*this)) |
| 76 , m_selection(FrameSelection::create(this)) | 76 , m_selection(FrameSelection::create(this)) |
| 77 , m_eventHandler(adoptPtr(new EventHandler(this))) | 77 , m_eventHandler(adoptPtr(new EventHandler(this))) |
| 78 , m_console(FrameConsole::create(*this)) | 78 , m_console(FrameConsole::create(*this)) |
| 79 , m_inputMethodController(InputMethodController::create(*this)) | 79 , m_inputMethodController(InputMethodController::create(*this)) |
| 80 , m_pageZoomFactor(1) | |
| 81 , m_textZoomFactor(1) | |
| 82 { | 80 { |
| 83 page()->setMainFrame(this); | 81 page()->setMainFrame(this); |
| 84 } | 82 } |
| 85 | 83 |
| 86 PassRefPtr<LocalFrame> LocalFrame::create(FrameLoaderClient* client, FrameHost*
host) | 84 PassRefPtr<LocalFrame> LocalFrame::create(FrameLoaderClient* client, FrameHost*
host) |
| 87 { | 85 { |
| 88 return adoptRef(new LocalFrame(client, host)); | 86 return adoptRef(new LocalFrame(client, host)); |
| 89 } | 87 } |
| 90 | 88 |
| 91 LocalFrame::~LocalFrame() | 89 LocalFrame::~LocalFrame() |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 } | 338 } |
| 341 | 339 |
| 342 String LocalFrame::localLayerTreeAsText(unsigned flags) const | 340 String LocalFrame::localLayerTreeAsText(unsigned flags) const |
| 343 { | 341 { |
| 344 if (!contentRenderer()) | 342 if (!contentRenderer()) |
| 345 return String(); | 343 return String(); |
| 346 | 344 |
| 347 return contentRenderer()->compositor()->layerTreeAsText(static_cast<LayerTre
eFlags>(flags)); | 345 return contentRenderer()->compositor()->layerTreeAsText(static_cast<LayerTre
eFlags>(flags)); |
| 348 } | 346 } |
| 349 | 347 |
| 350 void LocalFrame::setPageZoomFactor(float factor) | |
| 351 { | |
| 352 setPageAndTextZoomFactors(factor, m_textZoomFactor); | |
| 353 } | |
| 354 | |
| 355 void LocalFrame::setTextZoomFactor(float factor) | |
| 356 { | |
| 357 setPageAndTextZoomFactors(m_pageZoomFactor, factor); | |
| 358 } | |
| 359 | |
| 360 void LocalFrame::setPageAndTextZoomFactors(float pageZoomFactor, float textZoomF
actor) | |
| 361 { | |
| 362 if (m_pageZoomFactor == pageZoomFactor && m_textZoomFactor == textZoomFactor
) | |
| 363 return; | |
| 364 | |
| 365 Page* page = this->page(); | |
| 366 if (!page) | |
| 367 return; | |
| 368 | |
| 369 Document* document = this->document(); | |
| 370 if (!document) | |
| 371 return; | |
| 372 | |
| 373 m_pageZoomFactor = pageZoomFactor; | |
| 374 m_textZoomFactor = textZoomFactor; | |
| 375 | |
| 376 document->setNeedsStyleRecalc(SubtreeStyleChange); | |
| 377 document->updateLayoutIgnorePendingStylesheets(); | |
| 378 } | |
| 379 | |
| 380 void LocalFrame::deviceOrPageScaleFactorChanged() | 348 void LocalFrame::deviceOrPageScaleFactorChanged() |
| 381 { | 349 { |
| 382 document()->mediaQueryAffectingValueChanged(); | 350 document()->mediaQueryAffectingValueChanged(); |
| 383 } | 351 } |
| 384 | 352 |
| 385 void LocalFrame::removeSpellingMarkersUnderWords(const Vector<String>& words) | 353 void LocalFrame::removeSpellingMarkersUnderWords(const Vector<String>& words) |
| 386 { | 354 { |
| 387 spellChecker().removeSpellingMarkersUnderWords(words); | 355 spellChecker().removeSpellingMarkersUnderWords(words); |
| 388 } | 356 } |
| 389 | 357 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 401 } | 369 } |
| 402 | 370 |
| 403 LocalFrame* frame; | 371 LocalFrame* frame; |
| 404 PaintBehavior paintBehavior; | 372 PaintBehavior paintBehavior; |
| 405 }; | 373 }; |
| 406 | 374 |
| 407 double LocalFrame::devicePixelRatio() const | 375 double LocalFrame::devicePixelRatio() const |
| 408 { | 376 { |
| 409 if (!m_host) | 377 if (!m_host) |
| 410 return 0; | 378 return 0; |
| 411 | 379 return m_host->deviceScaleFactor(); |
| 412 double ratio = m_host->deviceScaleFactor(); | |
| 413 ratio *= pageZoomFactor(); | |
| 414 return ratio; | |
| 415 } | 380 } |
| 416 | 381 |
| 417 } // namespace blink | 382 } // namespace blink |
| OLD | NEW |