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

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

Issue 15820002: Page::chrome() should return a reference. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 7 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') | no next file » | 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 ASSERT(page); 195 ASSERT(page);
196 196
197 page->setDeviceScaleFactor(1); 197 page->setDeviceScaleFactor(1);
198 page->setPageScaleFactor(1, IntPoint(0, 0)); 198 page->setPageScaleFactor(1, IntPoint(0, 0));
199 page->setPagination(Pagination()); 199 page->setPagination(Pagination());
200 TextRun::setAllowsRoundingHacks(false); 200 TextRun::setAllowsRoundingHacks(false);
201 WebCore::overrideUserPreferredLanguages(Vector<String>()); 201 WebCore::overrideUserPreferredLanguages(Vector<String>());
202 WebCore::Settings::setUsesOverlayScrollbars(false); 202 WebCore::Settings::setUsesOverlayScrollbars(false);
203 delete s_pagePopupDriver; 203 delete s_pagePopupDriver;
204 s_pagePopupDriver = 0; 204 s_pagePopupDriver = 0;
205 if (page->chrome()) 205 page->chrome().client()->resetPagePopupDriver();
206 page->chrome()->client()->resetPagePopupDriver();
207 if (page->inspectorController()) 206 if (page->inspectorController())
208 page->inspectorController()->setProfilerEnabled(false); 207 page->inspectorController()->setProfilerEnabled(false);
209 page->group().captionPreferences()->setTestingMode(false); 208 page->group().captionPreferences()->setTestingMode(false);
210 if (!page->mainFrame()->editor()->isContinuousSpellCheckingEnabled()) 209 if (!page->mainFrame()->editor()->isContinuousSpellCheckingEnabled())
211 page->mainFrame()->editor()->toggleContinuousSpellChecking(); 210 page->mainFrame()->editor()->toggleContinuousSpellChecking();
212 if (page->mainFrame()->editor()->isOverwriteModeEnabled()) 211 if (page->mainFrame()->editor()->isOverwriteModeEnabled())
213 page->mainFrame()->editor()->toggleOverwriteModeEnabled(); 212 page->mainFrame()->editor()->toggleOverwriteModeEnabled();
214 } 213 }
215 214
216 Internals::Internals(Document* document) 215 Internals::Internals(Document* document)
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 SpeechSynthesis* synthesis = DOMWindowSpeechSynthesis::speechSynthesis(docum ent->domWindow()); 726 SpeechSynthesis* synthesis = DOMWindowSpeechSynthesis::speechSynthesis(docum ent->domWindow());
728 if (!synthesis) 727 if (!synthesis)
729 return; 728 return;
730 729
731 synthesis->setPlatformSynthesizer(PlatformSpeechSynthesizerMock::create(synt hesis)); 730 synthesis->setPlatformSynthesizer(PlatformSpeechSynthesizerMock::create(synt hesis));
732 } 731 }
733 732
734 void Internals::setEnableMockPagePopup(bool enabled, ExceptionCode& ec) 733 void Internals::setEnableMockPagePopup(bool enabled, ExceptionCode& ec)
735 { 734 {
736 Document* document = contextDocument(); 735 Document* document = contextDocument();
737 if (!document || !document->page() || !document->page()->chrome()) 736 if (!document || !document->page())
738 return; 737 return;
739 Page* page = document->page(); 738 Page* page = document->page();
740 if (!enabled) { 739 if (!enabled) {
741 page->chrome()->client()->resetPagePopupDriver(); 740 page->chrome().client()->resetPagePopupDriver();
742 return; 741 return;
743 } 742 }
744 if (!s_pagePopupDriver) 743 if (!s_pagePopupDriver)
745 s_pagePopupDriver = MockPagePopupDriver::create(page->mainFrame()).leakP tr(); 744 s_pagePopupDriver = MockPagePopupDriver::create(page->mainFrame()).leakP tr();
746 page->chrome()->client()->setPagePopupDriver(s_pagePopupDriver); 745 page->chrome().client()->setPagePopupDriver(s_pagePopupDriver);
747 } 746 }
748 747
749 PassRefPtr<PagePopupController> Internals::pagePopupController() 748 PassRefPtr<PagePopupController> Internals::pagePopupController()
750 { 749 {
751 return s_pagePopupDriver ? s_pagePopupDriver->pagePopupController() : 0; 750 return s_pagePopupDriver ? s_pagePopupDriver->pagePopupController() : 0;
752 } 751 }
753 752
754 PassRefPtr<ClientRect> Internals::absoluteCaretBounds(ExceptionCode& ec) 753 PassRefPtr<ClientRect> Internals::absoluteCaretBounds(ExceptionCode& ec)
755 { 754 {
756 Document* document = contextDocument(); 755 Document* document = contextDocument();
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1936 1935
1937 RenderObject* renderer = select->renderer(); 1936 RenderObject* renderer = select->renderer();
1938 if (!renderer->isMenuList()) 1937 if (!renderer->isMenuList())
1939 return false; 1938 return false;
1940 1939
1941 RenderMenuList* menuList = toRenderMenuList(renderer); 1940 RenderMenuList* menuList = toRenderMenuList(renderer);
1942 return menuList->popupIsVisible(); 1941 return menuList->popupIsVisible();
1943 } 1942 }
1944 1943
1945 } 1944 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGAElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698