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

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

Issue 336553003: Change Page::m_mainFrame to be a Frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 6 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
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 ASSERT(page); 184 ASSERT(page);
185 185
186 page->setDeviceScaleFactor(1); 186 page->setDeviceScaleFactor(1);
187 page->setIsCursorVisible(true); 187 page->setIsCursorVisible(true);
188 page->setPageScaleFactor(1, IntPoint(0, 0)); 188 page->setPageScaleFactor(1, IntPoint(0, 0));
189 TextRun::setAllowsRoundingHacks(false); 189 TextRun::setAllowsRoundingHacks(false);
190 WebCore::overrideUserPreferredLanguages(Vector<AtomicString>()); 190 WebCore::overrideUserPreferredLanguages(Vector<AtomicString>());
191 delete s_pagePopupDriver; 191 delete s_pagePopupDriver;
192 s_pagePopupDriver = 0; 192 s_pagePopupDriver = 0;
193 page->chrome().client().resetPagePopupDriver(); 193 page->chrome().client().resetPagePopupDriver();
194 if (!page->mainFrame()->spellChecker().isContinuousSpellCheckingEnabled()) 194 if (!page->deprecatedLocalMainFrame()->spellChecker().isContinuousSpellCheck ingEnabled())
195 page->mainFrame()->spellChecker().toggleContinuousSpellChecking(); 195 page->deprecatedLocalMainFrame()->spellChecker().toggleContinuousSpellCh ecking();
196 if (page->mainFrame()->editor().isOverwriteModeEnabled()) 196 if (page->deprecatedLocalMainFrame()->editor().isOverwriteModeEnabled())
197 page->mainFrame()->editor().toggleOverwriteModeEnabled(); 197 page->deprecatedLocalMainFrame()->editor().toggleOverwriteModeEnabled();
198 198
199 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator( )) 199 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator( ))
200 scrollingCoordinator->reset(); 200 scrollingCoordinator->reset();
201 201
202 page->mainFrame()->view()->clear(); 202 page->deprecatedLocalMainFrame()->view()->clear();
203 } 203 }
204 204
205 Internals::Internals(Document* document) 205 Internals::Internals(Document* document)
206 : ContextLifecycleObserver(document) 206 : ContextLifecycleObserver(document)
207 , m_runtimeFlags(InternalRuntimeFlags::create()) 207 , m_runtimeFlags(InternalRuntimeFlags::create())
208 { 208 {
209 } 209 }
210 210
211 Document* Internals::contextDocument() const 211 Document* Internals::contextDocument() const
212 { 212 {
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 { 721 {
722 Document* document = contextDocument(); 722 Document* document = contextDocument();
723 if (!document || !document->page()) 723 if (!document || !document->page())
724 return; 724 return;
725 Page* page = document->page(); 725 Page* page = document->page();
726 if (!enabled) { 726 if (!enabled) {
727 page->chrome().client().resetPagePopupDriver(); 727 page->chrome().client().resetPagePopupDriver();
728 return; 728 return;
729 } 729 }
730 if (!s_pagePopupDriver) 730 if (!s_pagePopupDriver)
731 s_pagePopupDriver = MockPagePopupDriver::create(page->mainFrame()).leakP tr(); 731 s_pagePopupDriver = MockPagePopupDriver::create(page->deprecatedLocalMai nFrame()).leakPtr();
732 page->chrome().client().setPagePopupDriver(s_pagePopupDriver); 732 page->chrome().client().setPagePopupDriver(s_pagePopupDriver);
733 } 733 }
734 734
735 PassRefPtrWillBeRawPtr<PagePopupController> Internals::pagePopupController() 735 PassRefPtrWillBeRawPtr<PagePopupController> Internals::pagePopupController()
736 { 736 {
737 return s_pagePopupDriver ? s_pagePopupDriver->pagePopupController() : 0; 737 return s_pagePopupDriver ? s_pagePopupDriver->pagePopupController() : 0;
738 } 738 }
739 739
740 PassRefPtrWillBeRawPtr<ClientRect> Internals::unscaledViewportRect(ExceptionStat e& exceptionState) 740 PassRefPtrWillBeRawPtr<ClientRect> Internals::unscaledViewportRect(ExceptionStat e& exceptionState)
741 { 741 {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's page cannot be retrieved." : "The document provided is invalid."); 892 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's page cannot be retrieved." : "The document provided is invalid.");
893 return String(); 893 return String();
894 } 894 }
895 895
896 document->updateLayoutIgnorePendingStylesheets(); 896 document->updateLayoutIgnorePendingStylesheets();
897 897
898 Page* page = document->page(); 898 Page* page = document->page();
899 899
900 // Update initial viewport size. 900 // Update initial viewport size.
901 IntSize initialViewportSize(availableWidth, availableHeight); 901 IntSize initialViewportSize(availableWidth, availableHeight);
902 document->page()->mainFrame()->view()->setFrameRect(IntRect(IntPoint::zero() , initialViewportSize)); 902 document->page()->deprecatedLocalMainFrame()->view()->setFrameRect(IntRect(I ntPoint::zero(), initialViewportSize));
903 903
904 ViewportDescription description = page->viewportDescription(); 904 ViewportDescription description = page->viewportDescription();
905 PageScaleConstraints constraints = description.resolve(initialViewportSize, Length()); 905 PageScaleConstraints constraints = description.resolve(initialViewportSize, Length());
906 906
907 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt h); 907 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt h);
908 908
909 StringBuilder builder; 909 StringBuilder builder;
910 910
911 builder.appendLiteral("viewport size "); 911 builder.appendLiteral("viewport size ");
912 builder.append(String::number(constraints.layoutSize.width())); 912 builder.append(String::number(constraints.layoutSize.width()));
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after
2358 } else if (type == "none") { 2358 } else if (type == "none") {
2359 webtype = blink::ConnectionTypeNone; 2359 webtype = blink::ConnectionTypeNone;
2360 } else { 2360 } else {
2361 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type)); 2361 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type));
2362 return; 2362 return;
2363 } 2363 }
2364 networkStateNotifier().setWebConnectionTypeForTest(webtype); 2364 networkStateNotifier().setWebConnectionTypeForTest(webtype);
2365 } 2365 }
2366 2366
2367 } // namespace WebCore 2367 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/svg/graphics/SVGImage.cpp ('k') | Source/modules/device_orientation/DeviceOrientationInspectorAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698