Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 115293005: Add a layer of indirection between Frame and Page (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make GCC happy Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/page/Page.cpp ('k') | Source/core/testing/DummyPageHolder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 // won't know to break the cycle. 382 // won't know to break the cycle.
383 // This will become an issue when SVGImage will be able to load other 383 // This will become an issue when SVGImage will be able to load other
384 // SVGImage objects, but we're safe now, because SVGImage can only be 384 // SVGImage objects, but we're safe now, because SVGImage can only be
385 // loaded by a top-level document. 385 // loaded by a top-level document.
386 m_page = adoptPtr(new Page(pageClients)); 386 m_page = adoptPtr(new Page(pageClients));
387 m_page->settings().setMediaEnabled(false); 387 m_page->settings().setMediaEnabled(false);
388 m_page->settings().setScriptEnabled(false); 388 m_page->settings().setScriptEnabled(false);
389 m_page->settings().setPluginsEnabled(false); 389 m_page->settings().setPluginsEnabled(false);
390 m_page->settings().setAcceleratedCompositingEnabled(false); 390 m_page->settings().setAcceleratedCompositingEnabled(false);
391 391
392 RefPtr<Frame> frame = Frame::create(FrameInit::create(0, m_page.get(), d ummyFrameLoaderClient)); 392 RefPtr<Frame> frame = Frame::create(FrameInit::create(0, &m_page->frameH ost(), dummyFrameLoaderClient));
393 frame->setView(FrameView::create(frame.get())); 393 frame->setView(FrameView::create(frame.get()));
394 frame->init(); 394 frame->init();
395 FrameLoader& loader = frame->loader(); 395 FrameLoader& loader = frame->loader();
396 loader.forceSandboxFlags(SandboxAll); 396 loader.forceSandboxFlags(SandboxAll);
397 397
398 frame->view()->setScrollbarsSuppressed(true); 398 frame->view()->setScrollbarsSuppressed(true);
399 frame->view()->setCanHaveScrollbars(false); // SVG Images will always sy nthesize a viewBox, if it's not available, and thus never see scrollbars. 399 frame->view()->setCanHaveScrollbars(false); // SVG Images will always sy nthesize a viewBox, if it's not available, and thus never see scrollbars.
400 frame->view()->setTransparent(true); // SVG Images are transparent. 400 frame->view()->setTransparent(true); // SVG Images are transparent.
401 401
402 ASSERT(loader.activeDocumentLoader()); // DocumentLoader should have bee n created by frame->init(). 402 ASSERT(loader.activeDocumentLoader()); // DocumentLoader should have bee n created by frame->init().
403 DocumentWriter* writer = loader.activeDocumentLoader()->beginWriting("im age/svg+xml", "UTF-8"); 403 DocumentWriter* writer = loader.activeDocumentLoader()->beginWriting("im age/svg+xml", "UTF-8");
404 writer->addData(data()->data(), data()->size()); 404 writer->addData(data()->data(), data()->size());
405 loader.activeDocumentLoader()->endWriting(writer); 405 loader.activeDocumentLoader()->endWriting(writer);
406 // Set the intrinsic size before a container size is available. 406 // Set the intrinsic size before a container size is available.
407 m_intrinsicSize = containerSize(); 407 m_intrinsicSize = containerSize();
408 } 408 }
409 409
410 return m_page; 410 return m_page;
411 } 411 }
412 412
413 String SVGImage::filenameExtension() const 413 String SVGImage::filenameExtension() const
414 { 414 {
415 return "svg"; 415 return "svg";
416 } 416 }
417 417
418 } 418 }
OLDNEW
« no previous file with comments | « Source/core/page/Page.cpp ('k') | Source/core/testing/DummyPageHolder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698