| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "core/testing/DummyPageHolder.h" | 32 #include "core/testing/DummyPageHolder.h" |
| 33 | 33 |
| 34 #include "core/frame/LocalDOMWindow.h" | 34 #include "core/frame/LocalDOMWindow.h" |
| 35 #include "core/frame/FrameView.h" | 35 #include "core/frame/FrameView.h" |
| 36 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
| 37 #include "core/frame/Settings.h" | 37 #include "core/frame/Settings.h" |
| 38 #include "wtf/Assertions.h" | 38 #include "wtf/Assertions.h" |
| 39 | 39 |
| 40 namespace WebCore { | 40 namespace WebCore { |
| 41 | 41 |
| 42 PassOwnPtr<DummyPageHolder> DummyPageHolder::create(const IntSize& initialViewSi
ze) | 42 PassOwnPtr<DummyPageHolder> DummyPageHolder::create(const IntSize& initialViewSi
ze, Page::PageClients* pageClients) |
| 43 { | 43 { |
| 44 return adoptPtr(new DummyPageHolder(initialViewSize)); | 44 return adoptPtr(new DummyPageHolder(initialViewSize, pageClients)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 DummyPageHolder::DummyPageHolder(const IntSize& initialViewSize) | 47 DummyPageHolder::DummyPageHolder(const IntSize& initialViewSize, Page::PageClien
ts* pageClients) |
| 48 { | 48 { |
| 49 fillWithEmptyClients(m_pageClients); | 49 if (!pageClients) { |
| 50 fillWithEmptyClients(m_pageClients); |
| 51 } else { |
| 52 m_pageClients.chromeClient = pageClients->chromeClient; |
| 53 m_pageClients.contextMenuClient = pageClients->contextMenuClient; |
| 54 m_pageClients.editorClient = pageClients->editorClient; |
| 55 m_pageClients.dragClient = pageClients->dragClient; |
| 56 m_pageClients.inspectorClient = pageClients->inspectorClient; |
| 57 m_pageClients.backForwardClient = pageClients->backForwardClient; |
| 58 m_pageClients.spellCheckerClient = pageClients->spellCheckerClient; |
| 59 m_pageClients.storageClient = pageClients->storageClient; |
| 60 } |
| 50 m_page = adoptPtrWillBeNoop(new Page(m_pageClients)); | 61 m_page = adoptPtrWillBeNoop(new Page(m_pageClients)); |
| 51 Settings& settings = m_page->settings(); | 62 Settings& settings = m_page->settings(); |
| 52 // FIXME: http://crbug.com/363843. This needs to find a better way to | 63 // FIXME: http://crbug.com/363843. This needs to find a better way to |
| 53 // not create graphics layers. | 64 // not create graphics layers. |
| 54 settings.setAcceleratedCompositingEnabled(false); | 65 settings.setAcceleratedCompositingEnabled(false); |
| 55 | 66 |
| 56 m_frame = LocalFrame::create(&m_frameLoaderClient, &m_page->frameHost(), 0); | 67 m_frame = LocalFrame::create(&m_frameLoaderClient, &m_page->frameHost(), 0); |
| 57 m_frame->setView(FrameView::create(m_frame.get(), initialViewSize)); | 68 m_frame->setView(FrameView::create(m_frame.get(), initialViewSize)); |
| 58 m_frame->init(); | 69 m_frame->init(); |
| 59 } | 70 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 82 { | 93 { |
| 83 return *m_frame->view(); | 94 return *m_frame->view(); |
| 84 } | 95 } |
| 85 | 96 |
| 86 Document& DummyPageHolder::document() const | 97 Document& DummyPageHolder::document() const |
| 87 { | 98 { |
| 88 return *m_frame->domWindow()->document(); | 99 return *m_frame->domWindow()->document(); |
| 89 } | 100 } |
| 90 | 101 |
| 91 } // namespace WebCore | 102 } // namespace WebCore |
| OLD | NEW |