OLD | NEW |
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 #include <wtf/text/StringBuffer.h> | 102 #include <wtf/text/StringBuffer.h> |
103 | 103 |
104 #if ENABLE(INPUT_TYPE_COLOR) | 104 #if ENABLE(INPUT_TYPE_COLOR) |
105 #include "core/platform/ColorChooser.h" | 105 #include "core/platform/ColorChooser.h" |
106 #endif | 106 #endif |
107 | 107 |
108 #if ENABLE(BATTERY_STATUS) | 108 #if ENABLE(BATTERY_STATUS) |
109 #include "modules/battery/BatteryController.h" | 109 #include "modules/battery/BatteryController.h" |
110 #endif | 110 #endif |
111 | 111 |
112 #if ENABLE(PAGE_POPUP) | |
113 #include "core/page/PagePopupController.h" | 112 #include "core/page/PagePopupController.h" |
114 #endif | |
115 | 113 |
116 #include "core/platform/graphics/GraphicsLayer.h" | 114 #include "core/platform/graphics/GraphicsLayer.h" |
117 #include "core/platform/graphics/chromium/GraphicsLayerChromium.h" | 115 #include "core/platform/graphics/chromium/GraphicsLayerChromium.h" |
118 #include "core/platform/graphics/filters/FilterOperation.h" | 116 #include "core/platform/graphics/filters/FilterOperation.h" |
119 #include "core/platform/graphics/filters/FilterOperations.h" | 117 #include "core/platform/graphics/filters/FilterOperations.h" |
120 #include "core/rendering/RenderLayerBacking.h" | 118 #include "core/rendering/RenderLayerBacking.h" |
121 | 119 |
122 #if ENABLE(ENCRYPTED_MEDIA_V2) | 120 #if ENABLE(ENCRYPTED_MEDIA_V2) |
123 #include "CDM.h" | 121 #include "CDM.h" |
124 #include "MockCDM.h" | 122 #include "MockCDM.h" |
125 #endif | 123 #endif |
126 | 124 |
127 #include "core/page/CaptionUserPreferences.h" | 125 #include "core/page/CaptionUserPreferences.h" |
128 #include "core/page/PageGroup.h" | 126 #include "core/page/PageGroup.h" |
129 | 127 |
130 #if ENABLE(SPEECH_SYNTHESIS) | 128 #if ENABLE(SPEECH_SYNTHESIS) |
131 #include "core/platform/mock/PlatformSpeechSynthesizerMock.h" | 129 #include "core/platform/mock/PlatformSpeechSynthesizerMock.h" |
132 #include "modules/speech/DOMWindowSpeechSynthesis.h" | 130 #include "modules/speech/DOMWindowSpeechSynthesis.h" |
133 #include "modules/speech/SpeechSynthesis.h" | 131 #include "modules/speech/SpeechSynthesis.h" |
134 #endif | 132 #endif |
135 | 133 |
136 namespace WebCore { | 134 namespace WebCore { |
137 | 135 |
138 #if ENABLE(PAGE_POPUP) | |
139 static MockPagePopupDriver* s_pagePopupDriver = 0; | 136 static MockPagePopupDriver* s_pagePopupDriver = 0; |
140 #endif | |
141 | 137 |
142 using namespace HTMLNames; | 138 using namespace HTMLNames; |
143 | 139 |
144 class InspectorFrontendChannelDummy : public InspectorFrontendChannel { | 140 class InspectorFrontendChannelDummy : public InspectorFrontendChannel { |
145 public: | 141 public: |
146 explicit InspectorFrontendChannelDummy(Page*); | 142 explicit InspectorFrontendChannelDummy(Page*); |
147 virtual ~InspectorFrontendChannelDummy() { } | 143 virtual ~InspectorFrontendChannelDummy() { } |
148 virtual bool sendMessageToFrontend(const String& message) OVERRIDE; | 144 virtual bool sendMessageToFrontend(const String& message) OVERRIDE; |
149 | 145 |
150 private: | 146 private: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 208 |
213 void Internals::resetToConsistentState(Page* page) | 209 void Internals::resetToConsistentState(Page* page) |
214 { | 210 { |
215 ASSERT(page); | 211 ASSERT(page); |
216 | 212 |
217 page->setPageScaleFactor(1, IntPoint(0, 0)); | 213 page->setPageScaleFactor(1, IntPoint(0, 0)); |
218 page->setPagination(Pagination()); | 214 page->setPagination(Pagination()); |
219 TextRun::setAllowsRoundingHacks(false); | 215 TextRun::setAllowsRoundingHacks(false); |
220 WebCore::overrideUserPreferredLanguages(Vector<String>()); | 216 WebCore::overrideUserPreferredLanguages(Vector<String>()); |
221 WebCore::Settings::setUsesOverlayScrollbars(false); | 217 WebCore::Settings::setUsesOverlayScrollbars(false); |
222 #if ENABLE(PAGE_POPUP) | |
223 delete s_pagePopupDriver; | 218 delete s_pagePopupDriver; |
224 s_pagePopupDriver = 0; | 219 s_pagePopupDriver = 0; |
225 if (page->chrome()) | 220 if (page->chrome()) |
226 page->chrome()->client()->resetPagePopupDriver(); | 221 page->chrome()->client()->resetPagePopupDriver(); |
227 #endif | |
228 if (page->inspectorController()) | 222 if (page->inspectorController()) |
229 page->inspectorController()->setProfilerEnabled(false); | 223 page->inspectorController()->setProfilerEnabled(false); |
230 page->group().captionPreferences()->setTestingMode(false); | 224 page->group().captionPreferences()->setTestingMode(false); |
231 if (!page->mainFrame()->editor()->isContinuousSpellCheckingEnabled()) | 225 if (!page->mainFrame()->editor()->isContinuousSpellCheckingEnabled()) |
232 page->mainFrame()->editor()->toggleContinuousSpellChecking(); | 226 page->mainFrame()->editor()->toggleContinuousSpellChecking(); |
233 if (page->mainFrame()->editor()->isOverwriteModeEnabled()) | 227 if (page->mainFrame()->editor()->isOverwriteModeEnabled()) |
234 page->mainFrame()->editor()->toggleOverwriteModeEnabled(); | 228 page->mainFrame()->editor()->toggleOverwriteModeEnabled(); |
235 } | 229 } |
236 | 230 |
237 Internals::Internals(Document* document) | 231 Internals::Internals(Document* document) |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 SpeechSynthesis* synthesis = DOMWindowSpeechSynthesis::speechSynthesis(docum
ent->domWindow()); | 798 SpeechSynthesis* synthesis = DOMWindowSpeechSynthesis::speechSynthesis(docum
ent->domWindow()); |
805 if (!synthesis) | 799 if (!synthesis) |
806 return; | 800 return; |
807 | 801 |
808 synthesis->setPlatformSynthesizer(PlatformSpeechSynthesizerMock::create(synt
hesis)); | 802 synthesis->setPlatformSynthesizer(PlatformSpeechSynthesizerMock::create(synt
hesis)); |
809 } | 803 } |
810 #endif | 804 #endif |
811 | 805 |
812 void Internals::setEnableMockPagePopup(bool enabled, ExceptionCode& ec) | 806 void Internals::setEnableMockPagePopup(bool enabled, ExceptionCode& ec) |
813 { | 807 { |
814 #if ENABLE(PAGE_POPUP) | |
815 Document* document = contextDocument(); | 808 Document* document = contextDocument(); |
816 if (!document || !document->page() || !document->page()->chrome()) | 809 if (!document || !document->page() || !document->page()->chrome()) |
817 return; | 810 return; |
818 Page* page = document->page(); | 811 Page* page = document->page(); |
819 if (!enabled) { | 812 if (!enabled) { |
820 page->chrome()->client()->resetPagePopupDriver(); | 813 page->chrome()->client()->resetPagePopupDriver(); |
821 return; | 814 return; |
822 } | 815 } |
823 if (!s_pagePopupDriver) | 816 if (!s_pagePopupDriver) |
824 s_pagePopupDriver = MockPagePopupDriver::create(page->mainFrame()).leakP
tr(); | 817 s_pagePopupDriver = MockPagePopupDriver::create(page->mainFrame()).leakP
tr(); |
825 page->chrome()->client()->setPagePopupDriver(s_pagePopupDriver); | 818 page->chrome()->client()->setPagePopupDriver(s_pagePopupDriver); |
826 #else | |
827 UNUSED_PARAM(enabled); | |
828 UNUSED_PARAM(ec); | |
829 #endif | |
830 } | 819 } |
831 | 820 |
832 #if ENABLE(PAGE_POPUP) | |
833 PassRefPtr<PagePopupController> Internals::pagePopupController() | 821 PassRefPtr<PagePopupController> Internals::pagePopupController() |
834 { | 822 { |
835 return s_pagePopupDriver ? s_pagePopupDriver->pagePopupController() : 0; | 823 return s_pagePopupDriver ? s_pagePopupDriver->pagePopupController() : 0; |
836 } | 824 } |
837 #endif | |
838 | 825 |
839 PassRefPtr<ClientRect> Internals::absoluteCaretBounds(ExceptionCode& ec) | 826 PassRefPtr<ClientRect> Internals::absoluteCaretBounds(ExceptionCode& ec) |
840 { | 827 { |
841 Document* document = contextDocument(); | 828 Document* document = contextDocument(); |
842 if (!document || !document->frame() || !document->frame()->selection()) { | 829 if (!document || !document->frame() || !document->frame()->selection()) { |
843 ec = INVALID_ACCESS_ERR; | 830 ec = INVALID_ACCESS_ERR; |
844 return ClientRect::create(); | 831 return ClientRect::create(); |
845 } | 832 } |
846 | 833 |
847 return ClientRect::create(document->frame()->selection()->absoluteCaretBound
s()); | 834 return ClientRect::create(document->frame()->selection()->absoluteCaretBound
s()); |
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 | 1984 |
1998 RenderObject* renderer = select->renderer(); | 1985 RenderObject* renderer = select->renderer(); |
1999 if (!renderer->isMenuList()) | 1986 if (!renderer->isMenuList()) |
2000 return false; | 1987 return false; |
2001 | 1988 |
2002 RenderMenuList* menuList = toRenderMenuList(renderer); | 1989 RenderMenuList* menuList = toRenderMenuList(renderer); |
2003 return menuList->popupIsVisible(); | 1990 return menuList->popupIsVisible(); |
2004 } | 1991 } |
2005 | 1992 |
2006 } | 1993 } |
OLD | NEW |