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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 22955006: Chrome::client() should return a ChromeClient reference. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months 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/svg/SVGAElement.cpp ('k') | Source/web/AutofillPopupMenuClient.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 ASSERT(page); 193 ASSERT(page);
194 194
195 page->setDeviceScaleFactor(1); 195 page->setDeviceScaleFactor(1);
196 page->setPageScaleFactor(1, IntPoint(0, 0)); 196 page->setPageScaleFactor(1, IntPoint(0, 0));
197 page->setPagination(Pagination()); 197 page->setPagination(Pagination());
198 TextRun::setAllowsRoundingHacks(false); 198 TextRun::setAllowsRoundingHacks(false);
199 WebCore::overrideUserPreferredLanguages(Vector<String>()); 199 WebCore::overrideUserPreferredLanguages(Vector<String>());
200 WebCore::Settings::setUsesOverlayScrollbars(false); 200 WebCore::Settings::setUsesOverlayScrollbars(false);
201 delete s_pagePopupDriver; 201 delete s_pagePopupDriver;
202 s_pagePopupDriver = 0; 202 s_pagePopupDriver = 0;
203 page->chrome().client()->resetPagePopupDriver(); 203 page->chrome().client().resetPagePopupDriver();
204 if (!page->mainFrame()->editor()->isContinuousSpellCheckingEnabled()) 204 if (!page->mainFrame()->editor()->isContinuousSpellCheckingEnabled())
205 page->mainFrame()->editor()->toggleContinuousSpellChecking(); 205 page->mainFrame()->editor()->toggleContinuousSpellChecking();
206 if (page->mainFrame()->editor()->isOverwriteModeEnabled()) 206 if (page->mainFrame()->editor()->isOverwriteModeEnabled())
207 page->mainFrame()->editor()->toggleOverwriteModeEnabled(); 207 page->mainFrame()->editor()->toggleOverwriteModeEnabled();
208 } 208 }
209 209
210 Internals::Internals(Document* document) 210 Internals::Internals(Document* document)
211 : ContextLifecycleObserver(document) 211 : ContextLifecycleObserver(document)
212 , m_runtimeFlags(InternalRuntimeFlags::create()) 212 , m_runtimeFlags(InternalRuntimeFlags::create())
213 , m_scrollingCoordinator(document->page()->scrollingCoordinator()) 213 , m_scrollingCoordinator(document->page()->scrollingCoordinator())
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 synthesis->setPlatformSynthesizer(PlatformSpeechSynthesizerMock::create(synt hesis)); 767 synthesis->setPlatformSynthesizer(PlatformSpeechSynthesizerMock::create(synt hesis));
768 } 768 }
769 769
770 void Internals::setEnableMockPagePopup(bool enabled, ExceptionState& es) 770 void Internals::setEnableMockPagePopup(bool enabled, ExceptionState& es)
771 { 771 {
772 Document* document = contextDocument(); 772 Document* document = contextDocument();
773 if (!document || !document->page()) 773 if (!document || !document->page())
774 return; 774 return;
775 Page* page = document->page(); 775 Page* page = document->page();
776 if (!enabled) { 776 if (!enabled) {
777 page->chrome().client()->resetPagePopupDriver(); 777 page->chrome().client().resetPagePopupDriver();
778 return; 778 return;
779 } 779 }
780 if (!s_pagePopupDriver) 780 if (!s_pagePopupDriver)
781 s_pagePopupDriver = MockPagePopupDriver::create(page->mainFrame()).leakP tr(); 781 s_pagePopupDriver = MockPagePopupDriver::create(page->mainFrame()).leakP tr();
782 page->chrome().client()->setPagePopupDriver(s_pagePopupDriver); 782 page->chrome().client().setPagePopupDriver(s_pagePopupDriver);
783 } 783 }
784 784
785 PassRefPtr<PagePopupController> Internals::pagePopupController() 785 PassRefPtr<PagePopupController> Internals::pagePopupController()
786 { 786 {
787 return s_pagePopupDriver ? s_pagePopupDriver->pagePopupController() : 0; 787 return s_pagePopupDriver ? s_pagePopupDriver->pagePopupController() : 0;
788 } 788 }
789 789
790 PassRefPtr<ClientRect> Internals::unscaledViewportRect(ExceptionState& es) 790 PassRefPtr<ClientRect> Internals::unscaledViewportRect(ExceptionState& es)
791 { 791 {
792 Document* document = contextDocument(); 792 Document* document = contextDocument();
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 return false; 2177 return false;
2178 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); 2178 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB);
2179 // To prevent tests that call loseSharedGraphicsContext3D from being 2179 // To prevent tests that call loseSharedGraphicsContext3D from being
2180 // flaky, we call finish so that the context is guaranteed to be lost 2180 // flaky, we call finish so that the context is guaranteed to be lost
2181 // synchronously (i.e. before returning). 2181 // synchronously (i.e. before returning).
2182 sharedContext->finish(); 2182 sharedContext->finish();
2183 return true; 2183 return true;
2184 } 2184 }
2185 2185
2186 } 2186 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGAElement.cpp ('k') | Source/web/AutofillPopupMenuClient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698