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

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

Issue 14466008: Switch speech synthesis from compile-flag to runtime-flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase, switch to RuntimeEnabledFeatures.in 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
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/modules/speech/DOMWindowSpeechSynthesis.h » ('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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 #include "core/rendering/RenderLayerBacking.h" 120 #include "core/rendering/RenderLayerBacking.h"
121 121
122 #if ENABLE(ENCRYPTED_MEDIA_V2) 122 #if ENABLE(ENCRYPTED_MEDIA_V2)
123 #include "CDM.h" 123 #include "CDM.h"
124 #include "MockCDM.h" 124 #include "MockCDM.h"
125 #endif 125 #endif
126 126
127 #include "core/page/CaptionUserPreferences.h" 127 #include "core/page/CaptionUserPreferences.h"
128 #include "core/page/PageGroup.h" 128 #include "core/page/PageGroup.h"
129 129
130 #if ENABLE(SPEECH_SYNTHESIS)
131 #include "core/platform/mock/PlatformSpeechSynthesizerMock.h" 130 #include "core/platform/mock/PlatformSpeechSynthesizerMock.h"
132 #include "modules/speech/DOMWindowSpeechSynthesis.h" 131 #include "modules/speech/DOMWindowSpeechSynthesis.h"
133 #include "modules/speech/SpeechSynthesis.h" 132 #include "modules/speech/SpeechSynthesis.h"
134 #endif
135 133
136 namespace WebCore { 134 namespace WebCore {
137 135
138 #if ENABLE(PAGE_POPUP) 136 #if ENABLE(PAGE_POPUP)
139 static MockPagePopupDriver* s_pagePopupDriver = 0; 137 static MockPagePopupDriver* s_pagePopupDriver = 0;
140 #endif 138 #endif
141 139
142 using namespace HTMLNames; 140 using namespace HTMLNames;
143 141
144 class InspectorFrontendChannelDummy : public InspectorFrontendChannel { 142 class InspectorFrontendChannelDummy : public InspectorFrontendChannel {
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 } 786 }
789 String uniqueName = frame()->tree()->uniqueName(); 787 String uniqueName = frame()->tree()->uniqueName();
790 if (mainItem->target() == uniqueName) 788 if (mainItem->target() == uniqueName)
791 mainItem->setDocumentState(state); 789 mainItem->setDocumentState(state);
792 else if (HistoryItem* subItem = mainItem->childItemWithTarget(uniqueName)) 790 else if (HistoryItem* subItem = mainItem->childItemWithTarget(uniqueName))
793 subItem->setDocumentState(state); 791 subItem->setDocumentState(state);
794 else 792 else
795 ec = INVALID_ACCESS_ERR; 793 ec = INVALID_ACCESS_ERR;
796 } 794 }
797 795
798 #if ENABLE(SPEECH_SYNTHESIS)
799 void Internals::enableMockSpeechSynthesizer() 796 void Internals::enableMockSpeechSynthesizer()
800 { 797 {
801 Document* document = contextDocument(); 798 Document* document = contextDocument();
802 if (!document || !document->domWindow()) 799 if (!document || !document->domWindow())
803 return; 800 return;
804 SpeechSynthesis* synthesis = DOMWindowSpeechSynthesis::speechSynthesis(docum ent->domWindow()); 801 SpeechSynthesis* synthesis = DOMWindowSpeechSynthesis::speechSynthesis(docum ent->domWindow());
805 if (!synthesis) 802 if (!synthesis)
806 return; 803 return;
807 804
808 synthesis->setPlatformSynthesizer(PlatformSpeechSynthesizerMock::create(synt hesis)); 805 synthesis->setPlatformSynthesizer(PlatformSpeechSynthesizerMock::create(synt hesis));
809 } 806 }
810 #endif
811 807
812 void Internals::setEnableMockPagePopup(bool enabled, ExceptionCode& ec) 808 void Internals::setEnableMockPagePopup(bool enabled, ExceptionCode& ec)
813 { 809 {
814 #if ENABLE(PAGE_POPUP) 810 #if ENABLE(PAGE_POPUP)
815 Document* document = contextDocument(); 811 Document* document = contextDocument();
816 if (!document || !document->page() || !document->page()->chrome()) 812 if (!document || !document->page() || !document->page()->chrome())
817 return; 813 return;
818 Page* page = document->page(); 814 Page* page = document->page();
819 if (!enabled) { 815 if (!enabled) {
820 page->chrome()->client()->resetPagePopupDriver(); 816 page->chrome()->client()->resetPagePopupDriver();
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1997 1993
1998 RenderObject* renderer = select->renderer(); 1994 RenderObject* renderer = select->renderer();
1999 if (!renderer->isMenuList()) 1995 if (!renderer->isMenuList())
2000 return false; 1996 return false;
2001 1997
2002 RenderMenuList* menuList = toRenderMenuList(renderer); 1998 RenderMenuList* menuList = toRenderMenuList(renderer);
2003 return menuList->popupIsVisible(); 1999 return menuList->popupIsVisible();
2004 } 2000 }
2005 2001
2006 } 2002 }
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/modules/speech/DOMWindowSpeechSynthesis.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698