| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 #include "wtf/text/StringBuffer.h" | 103 #include "wtf/text/StringBuffer.h" |
| 104 | 104 |
| 105 #if ENABLE(INPUT_TYPE_COLOR) | 105 #if ENABLE(INPUT_TYPE_COLOR) |
| 106 #include "core/platform/ColorChooser.h" | 106 #include "core/platform/ColorChooser.h" |
| 107 #endif | 107 #endif |
| 108 | 108 |
| 109 #if ENABLE(BATTERY_STATUS) | 109 #if ENABLE(BATTERY_STATUS) |
| 110 #include "modules/battery/BatteryController.h" | 110 #include "modules/battery/BatteryController.h" |
| 111 #endif | 111 #endif |
| 112 | 112 |
| 113 #if ENABLE(PAGE_POPUP) | |
| 114 #include "core/page/PagePopupController.h" | 113 #include "core/page/PagePopupController.h" |
| 115 #endif | |
| 116 | |
| 117 #include "core/platform/graphics/GraphicsLayer.h" | 114 #include "core/platform/graphics/GraphicsLayer.h" |
| 118 #include "core/platform/graphics/chromium/GraphicsLayerChromium.h" | 115 #include "core/platform/graphics/chromium/GraphicsLayerChromium.h" |
| 119 #include "core/platform/graphics/filters/FilterOperation.h" | 116 #include "core/platform/graphics/filters/FilterOperation.h" |
| 120 #include "core/platform/graphics/filters/FilterOperations.h" | 117 #include "core/platform/graphics/filters/FilterOperations.h" |
| 121 #include "core/rendering/RenderLayerBacking.h" | 118 #include "core/rendering/RenderLayerBacking.h" |
| 122 | 119 |
| 123 #if ENABLE(ENCRYPTED_MEDIA_V2) | 120 #if ENABLE(ENCRYPTED_MEDIA_V2) |
| 124 #include "CDM.h" | 121 #include "CDM.h" |
| 125 #include "MockCDM.h" | 122 #include "MockCDM.h" |
| 126 #endif | 123 #endif |
| 127 | 124 |
| 128 #include "core/page/CaptionUserPreferences.h" | 125 #include "core/page/CaptionUserPreferences.h" |
| 129 #include "core/page/PageGroup.h" | 126 #include "core/page/PageGroup.h" |
| 130 | 127 |
| 131 #include "core/platform/mock/PlatformSpeechSynthesizerMock.h" | 128 #include "core/platform/mock/PlatformSpeechSynthesizerMock.h" |
| 132 #include "modules/speech/DOMWindowSpeechSynthesis.h" | 129 #include "modules/speech/DOMWindowSpeechSynthesis.h" |
| 133 #include "modules/speech/SpeechSynthesis.h" | 130 #include "modules/speech/SpeechSynthesis.h" |
| 134 | 131 |
| 135 namespace WebCore { | 132 namespace WebCore { |
| 136 | 133 |
| 137 #if ENABLE(PAGE_POPUP) | |
| 138 static MockPagePopupDriver* s_pagePopupDriver = 0; | 134 static MockPagePopupDriver* s_pagePopupDriver = 0; |
| 139 #endif | |
| 140 | 135 |
| 141 using namespace HTMLNames; | 136 using namespace HTMLNames; |
| 142 | 137 |
| 143 class InspectorFrontendChannelDummy : public InspectorFrontendChannel { | 138 class InspectorFrontendChannelDummy : public InspectorFrontendChannel { |
| 144 public: | 139 public: |
| 145 explicit InspectorFrontendChannelDummy(Page*); | 140 explicit InspectorFrontendChannelDummy(Page*); |
| 146 virtual ~InspectorFrontendChannelDummy() { } | 141 virtual ~InspectorFrontendChannelDummy() { } |
| 147 virtual bool sendMessageToFrontend(const String& message) OVERRIDE; | 142 virtual bool sendMessageToFrontend(const String& message) OVERRIDE; |
| 148 | 143 |
| 149 private: | 144 private: |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 void Internals::resetToConsistentState(Page* page) | 193 void Internals::resetToConsistentState(Page* page) |
| 199 { | 194 { |
| 200 ASSERT(page); | 195 ASSERT(page); |
| 201 | 196 |
| 202 page->setDeviceScaleFactor(1); | 197 page->setDeviceScaleFactor(1); |
| 203 page->setPageScaleFactor(1, IntPoint(0, 0)); | 198 page->setPageScaleFactor(1, IntPoint(0, 0)); |
| 204 page->setPagination(Pagination()); | 199 page->setPagination(Pagination()); |
| 205 TextRun::setAllowsRoundingHacks(false); | 200 TextRun::setAllowsRoundingHacks(false); |
| 206 WebCore::overrideUserPreferredLanguages(Vector<String>()); | 201 WebCore::overrideUserPreferredLanguages(Vector<String>()); |
| 207 WebCore::Settings::setUsesOverlayScrollbars(false); | 202 WebCore::Settings::setUsesOverlayScrollbars(false); |
| 208 #if ENABLE(PAGE_POPUP) | |
| 209 delete s_pagePopupDriver; | 203 delete s_pagePopupDriver; |
| 210 s_pagePopupDriver = 0; | 204 s_pagePopupDriver = 0; |
| 211 if (page->chrome()) | 205 if (page->chrome()) |
| 212 page->chrome()->client()->resetPagePopupDriver(); | 206 page->chrome()->client()->resetPagePopupDriver(); |
| 213 #endif | |
| 214 if (page->inspectorController()) | 207 if (page->inspectorController()) |
| 215 page->inspectorController()->setProfilerEnabled(false); | 208 page->inspectorController()->setProfilerEnabled(false); |
| 216 page->group().captionPreferences()->setTestingMode(false); | 209 page->group().captionPreferences()->setTestingMode(false); |
| 217 if (!page->mainFrame()->editor()->isContinuousSpellCheckingEnabled()) | 210 if (!page->mainFrame()->editor()->isContinuousSpellCheckingEnabled()) |
| 218 page->mainFrame()->editor()->toggleContinuousSpellChecking(); | 211 page->mainFrame()->editor()->toggleContinuousSpellChecking(); |
| 219 if (page->mainFrame()->editor()->isOverwriteModeEnabled()) | 212 if (page->mainFrame()->editor()->isOverwriteModeEnabled()) |
| 220 page->mainFrame()->editor()->toggleOverwriteModeEnabled(); | 213 page->mainFrame()->editor()->toggleOverwriteModeEnabled(); |
| 221 } | 214 } |
| 222 | 215 |
| 223 Internals::Internals(Document* document) | 216 Internals::Internals(Document* document) |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 return; | 726 return; |
| 734 SpeechSynthesis* synthesis = DOMWindowSpeechSynthesis::speechSynthesis(docum
ent->domWindow()); | 727 SpeechSynthesis* synthesis = DOMWindowSpeechSynthesis::speechSynthesis(docum
ent->domWindow()); |
| 735 if (!synthesis) | 728 if (!synthesis) |
| 736 return; | 729 return; |
| 737 | 730 |
| 738 synthesis->setPlatformSynthesizer(PlatformSpeechSynthesizerMock::create(synt
hesis)); | 731 synthesis->setPlatformSynthesizer(PlatformSpeechSynthesizerMock::create(synt
hesis)); |
| 739 } | 732 } |
| 740 | 733 |
| 741 void Internals::setEnableMockPagePopup(bool enabled, ExceptionCode& ec) | 734 void Internals::setEnableMockPagePopup(bool enabled, ExceptionCode& ec) |
| 742 { | 735 { |
| 743 #if ENABLE(PAGE_POPUP) | |
| 744 Document* document = contextDocument(); | 736 Document* document = contextDocument(); |
| 745 if (!document || !document->page() || !document->page()->chrome()) | 737 if (!document || !document->page() || !document->page()->chrome()) |
| 746 return; | 738 return; |
| 747 Page* page = document->page(); | 739 Page* page = document->page(); |
| 748 if (!enabled) { | 740 if (!enabled) { |
| 749 page->chrome()->client()->resetPagePopupDriver(); | 741 page->chrome()->client()->resetPagePopupDriver(); |
| 750 return; | 742 return; |
| 751 } | 743 } |
| 752 if (!s_pagePopupDriver) | 744 if (!s_pagePopupDriver) |
| 753 s_pagePopupDriver = MockPagePopupDriver::create(page->mainFrame()).leakP
tr(); | 745 s_pagePopupDriver = MockPagePopupDriver::create(page->mainFrame()).leakP
tr(); |
| 754 page->chrome()->client()->setPagePopupDriver(s_pagePopupDriver); | 746 page->chrome()->client()->setPagePopupDriver(s_pagePopupDriver); |
| 755 #else | |
| 756 UNUSED_PARAM(enabled); | |
| 757 UNUSED_PARAM(ec); | |
| 758 #endif | |
| 759 } | 747 } |
| 760 | 748 |
| 761 #if ENABLE(PAGE_POPUP) | |
| 762 PassRefPtr<PagePopupController> Internals::pagePopupController() | 749 PassRefPtr<PagePopupController> Internals::pagePopupController() |
| 763 { | 750 { |
| 764 return s_pagePopupDriver ? s_pagePopupDriver->pagePopupController() : 0; | 751 return s_pagePopupDriver ? s_pagePopupDriver->pagePopupController() : 0; |
| 765 } | 752 } |
| 766 #endif | |
| 767 | 753 |
| 768 PassRefPtr<ClientRect> Internals::absoluteCaretBounds(ExceptionCode& ec) | 754 PassRefPtr<ClientRect> Internals::absoluteCaretBounds(ExceptionCode& ec) |
| 769 { | 755 { |
| 770 Document* document = contextDocument(); | 756 Document* document = contextDocument(); |
| 771 if (!document || !document->frame() || !document->frame()->selection()) { | 757 if (!document || !document->frame() || !document->frame()->selection()) { |
| 772 ec = INVALID_ACCESS_ERR; | 758 ec = INVALID_ACCESS_ERR; |
| 773 return ClientRect::create(); | 759 return ClientRect::create(); |
| 774 } | 760 } |
| 775 | 761 |
| 776 return ClientRect::create(document->frame()->selection()->absoluteCaretBound
s()); | 762 return ClientRect::create(document->frame()->selection()->absoluteCaretBound
s()); |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1938 | 1924 |
| 1939 RenderObject* renderer = select->renderer(); | 1925 RenderObject* renderer = select->renderer(); |
| 1940 if (!renderer->isMenuList()) | 1926 if (!renderer->isMenuList()) |
| 1941 return false; | 1927 return false; |
| 1942 | 1928 |
| 1943 RenderMenuList* menuList = toRenderMenuList(renderer); | 1929 RenderMenuList* menuList = toRenderMenuList(renderer); |
| 1944 return menuList->popupIsVisible(); | 1930 return menuList->popupIsVisible(); |
| 1945 } | 1931 } |
| 1946 | 1932 |
| 1947 } | 1933 } |
| OLD | NEW |