| 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 25 matching lines...) Expand all Loading... |
| 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 "core/loader/EmptyClients.h" | 38 #include "core/loader/EmptyClients.h" |
| 39 #include "wtf/Assertions.h" | 39 #include "wtf/Assertions.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 PassOwnPtr<DummyPageHolder> DummyPageHolder::create( | 43 PassOwnPtr<DummyPageHolder> DummyPageHolder::create( |
| 44 const IntSize& initialViewSize, | 44 const IntSize& initialViewSize, |
| 45 Page::PageClients* pageClients, | 45 Page::PageClients* pageClients, |
| 46 PassOwnPtr<FrameLoaderClient> frameLoaderClient) { | 46 PassOwnPtrWillBeRawPtr<FrameLoaderClient> frameLoaderClient) { |
| 47 return adoptPtr(new DummyPageHolder(initialViewSize, pageClients, frameLoade
rClient)); | 47 return adoptPtr(new DummyPageHolder(initialViewSize, pageClients, frameLoade
rClient)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 DummyPageHolder::DummyPageHolder( | 50 DummyPageHolder::DummyPageHolder( |
| 51 const IntSize& initialViewSize, | 51 const IntSize& initialViewSize, |
| 52 Page::PageClients* pageClientsArgument, | 52 Page::PageClients* pageClientsArgument, |
| 53 PassOwnPtr<FrameLoaderClient> frameLoaderClient) | 53 PassOwnPtrWillBeRawPtr<FrameLoaderClient> frameLoaderClient) |
| 54 { | 54 { |
| 55 Page::PageClients pageClients; | 55 Page::PageClients pageClients; |
| 56 if (!pageClientsArgument) { | 56 if (!pageClientsArgument) { |
| 57 fillWithEmptyClients(pageClients); | 57 fillWithEmptyClients(pageClients); |
| 58 } else { | 58 } else { |
| 59 pageClients.chromeClient = pageClientsArgument->chromeClient; | 59 pageClients.chromeClient = pageClientsArgument->chromeClient; |
| 60 pageClients.contextMenuClient = pageClientsArgument->contextMenuClient; | 60 pageClients.contextMenuClient = pageClientsArgument->contextMenuClient; |
| 61 pageClients.editorClient = pageClientsArgument->editorClient; | 61 pageClients.editorClient = pageClientsArgument->editorClient; |
| 62 pageClients.dragClient = pageClientsArgument->dragClient; | 62 pageClients.dragClient = pageClientsArgument->dragClient; |
| 63 pageClients.spellCheckerClient = pageClientsArgument->spellCheckerClient
; | 63 pageClients.spellCheckerClient = pageClientsArgument->spellCheckerClient
; |
| 64 } | 64 } |
| 65 m_page = adoptPtrWillBeNoop(new Page(pageClients)); | 65 m_page = adoptPtrWillBeNoop(new Page(pageClients)); |
| 66 Settings& settings = m_page->settings(); | 66 Settings& settings = m_page->settings(); |
| 67 // FIXME: http://crbug.com/363843. This needs to find a better way to | 67 // FIXME: http://crbug.com/363843. This needs to find a better way to |
| 68 // not create graphics layers. | 68 // not create graphics layers. |
| 69 settings.setAcceleratedCompositingEnabled(false); | 69 settings.setAcceleratedCompositingEnabled(false); |
| 70 | 70 |
| 71 m_frameLoaderClient = frameLoaderClient; | 71 m_frameLoaderClient = frameLoaderClient; |
| 72 if (!m_frameLoaderClient) | 72 if (!m_frameLoaderClient) |
| 73 m_frameLoaderClient = adoptPtr(new EmptyFrameLoaderClient); | 73 m_frameLoaderClient = EmptyFrameLoaderClient::create(); |
| 74 | 74 |
| 75 m_frame = LocalFrame::create(m_frameLoaderClient.get(), &m_page->frameHost()
, 0); | 75 m_frame = LocalFrame::create(m_frameLoaderClient.get(), &m_page->frameHost()
, 0); |
| 76 m_frame->setView(FrameView::create(m_frame.get(), initialViewSize)); | 76 m_frame->setView(FrameView::create(m_frame.get(), initialViewSize)); |
| 77 m_frame->init(); | 77 m_frame->init(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 DummyPageHolder::~DummyPageHolder() | 80 DummyPageHolder::~DummyPageHolder() |
| 81 { | 81 { |
| 82 m_page->willBeDestroyed(); | 82 m_page->willBeDestroyed(); |
| 83 m_page.clear(); | 83 m_page.clear(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 99 { | 99 { |
| 100 return *m_frame->view(); | 100 return *m_frame->view(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 Document& DummyPageHolder::document() const | 103 Document& DummyPageHolder::document() const |
| 104 { | 104 { |
| 105 return *m_frame->domWindow()->document(); | 105 return *m_frame->domWindow()->document(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace blink | 108 } // namespace blink |
| OLD | NEW |