WebPlatformStrategies.cpp revision 2bde8e466a4451c7319e3a072d118917957d6554
1/*
2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 *    notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 *    notice, this list of conditions and the following disclaimer in the
11 *    documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include "config.h"
27#include "WebPlatformStrategies.h"
28
29#include "WebLocalizableStrings.h"
30#include <WebCore/IntSize.h>
31#include <WebCore/Page.h>
32#include <WebCore/PageGroup.h>
33#include <WebCore/PluginDatabase.h>
34#include <wtf/MathExtras.h>
35#include <wtf/RetainPtr.h>
36
37using namespace WebCore;
38
39void WebPlatformStrategies::initialize()
40{
41    DEFINE_STATIC_LOCAL(WebPlatformStrategies, platformStrategies, ());
42}
43
44WebPlatformStrategies::WebPlatformStrategies()
45{
46    setPlatformStrategies(this);
47}
48
49CookiesStrategy* WebPlatformStrategies::createCookiesStrategy()
50{
51    return this;
52}
53
54PluginStrategy* WebPlatformStrategies::createPluginStrategy()
55{
56    return this;
57}
58
59LocalizationStrategy* WebPlatformStrategies::createLocalizationStrategy()
60{
61    return this;
62}
63
64VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy()
65{
66    return this;
67}
68
69void WebPlatformStrategies::notifyCookiesChanged()
70{
71}
72
73void WebPlatformStrategies::refreshPlugins()
74{
75    PluginDatabase::installedPlugins()->refresh();
76}
77
78void WebPlatformStrategies::getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>& outPlugins)
79{
80    const Vector<PluginPackage*>& plugins = PluginDatabase::installedPlugins()->plugins();
81
82    outPlugins.resize(plugins.size());
83
84    for (size_t i = 0; i < plugins.size(); ++i) {
85        PluginPackage* package = plugins[i];
86
87        PluginInfo info;
88        info.name = package->name();
89        info.file = package->fileName();
90        info.desc = package->description();
91
92        const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
93
94        info.mimes.reserveCapacity(mimeToDescriptions.size());
95
96        MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
97        for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
98            MimeClassInfo mime;
99
100            mime.type = it->first;
101            mime.desc = it->second;
102            mime.extensions = package->mimeToExtensions().get(mime.type);
103
104            info.mimes.append(mime);
105        }
106
107        outPlugins[i] = info;
108    }
109}
110
111// LocalizationStrategy
112
113String WebPlatformStrategies::searchableIndexIntroduction()
114{
115    return UI_STRING("This is a searchable index. Enter search keywords: ", "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'");
116}
117
118String WebPlatformStrategies::submitButtonDefaultLabel()
119{
120    return UI_STRING("Submit", "default label for Submit buttons in forms on web pages");
121}
122
123String WebPlatformStrategies::inputElementAltText()
124{
125    return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value");
126}
127
128String WebPlatformStrategies::resetButtonDefaultLabel()
129{
130    return UI_STRING("Reset", "default label for Reset buttons in forms on web pages");
131}
132
133String WebPlatformStrategies::fileButtonChooseFileLabel()
134{
135    return UI_STRING("Choose File", "title for file button used in HTML forms");
136}
137
138String WebPlatformStrategies::fileButtonNoFileSelectedLabel()
139{
140    return UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected");
141}
142
143String WebPlatformStrategies::defaultDetailsSummaryText()
144{
145    return UI_STRING("Details", "text to display in <details> tag when it has no <summary> child");
146}
147
148String WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow()
149{
150    return UI_STRING("Open Link in New Window", "Open in New Window context menu item");
151}
152
153String WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk()
154{
155    return UI_STRING("Download Linked File", "Download Linked File context menu item");
156}
157
158String WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard()
159{
160    return UI_STRING("Copy Link", "Copy Link context menu item");
161}
162
163String WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow()
164{
165    return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item");
166}
167
168String WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk()
169{
170    return UI_STRING("Download Image", "Download Image context menu item");
171}
172
173String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
174{
175    return UI_STRING("Copy Image", "Copy Image context menu item");
176}
177
178String WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow()
179{
180    return UI_STRING("Open Video in New Window", "Open Video in New Window context menu item");
181}
182
183String WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow()
184{
185    return UI_STRING("Open Audio in New Window", "Open Audio in New Window context menu item");
186}
187
188String WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard()
189{
190    return UI_STRING("Copy Video Address", "Copy Video Address Location context menu item");
191}
192
193String WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard()
194{
195    return UI_STRING("Copy Audio Address", "Copy Audio Address Location context menu item");
196}
197
198String WebPlatformStrategies::contextMenuItemTagToggleMediaControls()
199{
200    return UI_STRING("Controls", "Media Controls context menu item");
201}
202
203String WebPlatformStrategies::contextMenuItemTagToggleMediaLoop()
204{
205    return UI_STRING("Loop", "Media Loop context menu item");
206}
207
208String WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen()
209{
210    return UI_STRING("Enter Fullscreen", "Video Enter Fullscreen context menu item");
211}
212
213String WebPlatformStrategies::contextMenuItemTagMediaPlay()
214{
215    return UI_STRING("Play", "Media Play context menu item");
216}
217
218String WebPlatformStrategies::contextMenuItemTagMediaPause()
219{
220    return UI_STRING("Pause", "Media Pause context menu item");
221}
222
223String WebPlatformStrategies::contextMenuItemTagMediaMute()
224{
225    return UI_STRING("Mute", "Media Mute context menu item");
226}
227
228String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow()
229{
230    return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item");
231}
232
233String WebPlatformStrategies::contextMenuItemTagCopy()
234{
235    return UI_STRING("Copy", "Copy context menu item");
236}
237
238String WebPlatformStrategies::contextMenuItemTagGoBack()
239{
240    return UI_STRING("Back", "Back context menu item");
241}
242
243String WebPlatformStrategies::contextMenuItemTagGoForward()
244{
245    return UI_STRING("Forward", "Forward context menu item");
246}
247
248String WebPlatformStrategies::contextMenuItemTagStop()
249{
250    return UI_STRING("Stop", "Stop context menu item");
251}
252
253String WebPlatformStrategies::contextMenuItemTagReload()
254{
255    return UI_STRING("Reload", "Reload context menu item");
256}
257
258String WebPlatformStrategies::contextMenuItemTagCut()
259{
260    return UI_STRING("Cut", "Cut context menu item");
261}
262
263String WebPlatformStrategies::contextMenuItemTagPaste()
264{
265    return UI_STRING("Paste", "Paste context menu item");
266}
267
268String WebPlatformStrategies::contextMenuItemTagNoGuessesFound()
269{
270    return UI_STRING("No Guesses Found", "No Guesses Found context menu item");
271}
272
273String WebPlatformStrategies::contextMenuItemTagIgnoreSpelling()
274{
275    return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item");
276}
277
278String WebPlatformStrategies::contextMenuItemTagLearnSpelling()
279{
280    return UI_STRING("Learn Spelling", "Learn Spelling context menu item");
281}
282
283String WebPlatformStrategies::contextMenuItemTagSearchWeb()
284{
285    return UI_STRING("Search with Google", "Search in Google context menu item");
286}
287
288String WebPlatformStrategies::contextMenuItemTagLookUpInDictionary(const String&)
289{
290    return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item");
291}
292
293String WebPlatformStrategies::contextMenuItemTagOpenLink()
294{
295    return UI_STRING("Open Link", "Open Link context menu item");
296}
297
298String WebPlatformStrategies::contextMenuItemTagIgnoreGrammar()
299{
300    return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item");
301}
302
303String WebPlatformStrategies::contextMenuItemTagSpellingMenu()
304{
305    return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item");
306}
307
308String WebPlatformStrategies::contextMenuItemTagCheckSpelling()
309{
310    return UI_STRING("Check Document Now", "Check spelling context menu item");
311}
312
313String WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping()
314{
315    return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item");
316}
317
318String WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling()
319{
320    return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item");
321}
322
323String WebPlatformStrategies::contextMenuItemTagFontMenu()
324{
325    return UI_STRING("Font", "Font context sub-menu item");
326}
327
328String WebPlatformStrategies::contextMenuItemTagBold()
329{
330    return UI_STRING("Bold", "Bold context menu item");
331}
332
333String WebPlatformStrategies::contextMenuItemTagItalic()
334{
335    return UI_STRING("Italic", "Italic context menu item");
336}
337
338String WebPlatformStrategies::contextMenuItemTagUnderline()
339{
340    return UI_STRING("Underline", "Underline context menu item");
341}
342
343String WebPlatformStrategies::contextMenuItemTagOutline()
344{
345    return UI_STRING("Outline", "Outline context menu item");
346}
347
348String WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu()
349{
350    return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item");
351}
352
353String WebPlatformStrategies::contextMenuItemTagTextDirectionMenu()
354{
355    return UI_STRING("Selection Direction", "Selection direction context sub-menu item");
356}
357
358String WebPlatformStrategies::contextMenuItemTagDefaultDirection()
359{
360    return UI_STRING("Default", "Default writing direction context menu item");
361}
362
363String WebPlatformStrategies::contextMenuItemTagLeftToRight()
364{
365    return UI_STRING("Left to Right", "Left to Right context menu item");
366}
367
368String WebPlatformStrategies::contextMenuItemTagRightToLeft()
369{
370    return UI_STRING("Right to Left", "Right to Left context menu item");
371}
372
373String WebPlatformStrategies::contextMenuItemTagShowSpellingPanel(bool show)
374{
375    if (show)
376        return UI_STRING("Show Spelling and Grammar", "menu item title");
377    return UI_STRING("Hide Spelling and Grammar", "menu item title");
378}
379
380String WebPlatformStrategies::contextMenuItemTagInspectElement()
381{
382    return UI_STRING("Inspect Element", "Inspect Element context menu item");
383}
384
385String WebPlatformStrategies::searchMenuNoRecentSearchesText()
386{
387    return UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed");
388}
389
390String WebPlatformStrategies::searchMenuRecentSearchesText()
391{
392    return UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title");
393}
394
395String WebPlatformStrategies::searchMenuClearRecentSearchesText()
396{
397    return UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents");
398}
399
400String WebPlatformStrategies::AXWebAreaText()
401{
402    return UI_STRING("web area", "accessibility role description for web area");
403}
404
405String WebPlatformStrategies::AXLinkText()
406{
407    return UI_STRING("link", "accessibility role description for link");
408}
409
410String WebPlatformStrategies::AXListMarkerText()
411{
412    return UI_STRING("list marker", "accessibility role description for list marker");
413}
414
415String WebPlatformStrategies::AXImageMapText()
416{
417    return UI_STRING("image map", "accessibility role description for image map");
418}
419
420String WebPlatformStrategies::AXHeadingText()
421{
422    return UI_STRING("heading", "accessibility role description for headings");
423}
424
425String WebPlatformStrategies::AXDefinitionListTermText()
426{
427    return UI_STRING("term", "term word of a definition");
428}
429
430String WebPlatformStrategies::AXDefinitionListDefinitionText()
431{
432    return UI_STRING("definition", "definition phrase");
433}
434
435String WebPlatformStrategies::AXButtonActionVerb()
436{
437    return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility");
438}
439
440String WebPlatformStrategies::AXRadioButtonActionVerb()
441{
442    return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility");
443}
444
445String WebPlatformStrategies::AXTextFieldActionVerb()
446{
447    return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility");
448}
449
450String WebPlatformStrategies::AXCheckedCheckBoxActionVerb()
451{
452    return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility");
453}
454
455String WebPlatformStrategies::AXUncheckedCheckBoxActionVerb()
456{
457    return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility");
458}
459
460String WebPlatformStrategies::AXLinkActionVerb()
461{
462    return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility");
463}
464
465String WebPlatformStrategies::AXMenuListActionVerb()
466{
467    return UI_STRING("open", "Verb stating the action that will occur when a select element is clicked, as used by accessibility");
468}
469
470String WebPlatformStrategies::AXMenuListPopupActionVerb()
471{
472    return UI_STRING_KEY("press", "press (select element)", "Verb stating the action that will occur when a select element's popup list is clicked, as used by accessibility");
473}
474
475String WebPlatformStrategies::unknownFileSizeText()
476{
477    return UI_STRING("Unknown", "Unknown filesize FTP directory listing item");
478}
479
480String WebPlatformStrategies::uploadFileText()
481{
482    return UI_STRING("Upload file", "(Windows) Form submit file upload dialog title");
483}
484
485String WebPlatformStrategies::allFilesText()
486{
487    return UI_STRING("All Files", "(Windows) Form submit file upload all files pop-up");
488}
489
490String WebPlatformStrategies::missingPluginText()
491{
492    return UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing");
493}
494
495String WebPlatformStrategies::crashedPluginText()
496{
497    return UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed");
498}
499
500String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size)
501{
502    RetainPtr<CFStringRef> filenameCF(AdoptCF, filename.createCFString());
503    return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%@ %d\xC3\x97%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filenameCF.get(), size.width(), size.height())).get();
504}
505
506String WebPlatformStrategies::multipleFileUploadText(unsigned numberOfFiles)
507{
508    return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles)).get();
509}
510
511String WebPlatformStrategies::mediaElementLoadingStateText()
512{
513    return UI_STRING("Loading...", "Media controller status message when the media is loading");
514}
515
516String WebPlatformStrategies::mediaElementLiveBroadcastStateText()
517{
518    return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast");
519}
520
521String WebPlatformStrategies::localizedMediaControlElementString(const String& name)
522{
523    if (name == "AudioElement")
524        return UI_STRING("audio element controller", "accessibility role description for audio element controller");
525    if (name == "VideoElement")
526        return UI_STRING("video element controller", "accessibility role description for video element controller");
527    if (name == "MuteButton")
528        return UI_STRING("mute", "accessibility role description for mute button");
529    if (name == "UnMuteButton")
530        return UI_STRING("unmute", "accessibility role description for turn mute off button");
531    if (name == "PlayButton")
532        return UI_STRING("play", "accessibility role description for play button");
533    if (name == "PauseButton")
534        return UI_STRING("pause", "accessibility role description for pause button");
535    if (name == "Slider")
536        return UI_STRING("movie time", "accessibility role description for timeline slider");
537    if (name == "SliderThumb")
538        return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb");
539    if (name == "RewindButton")
540        return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button");
541    if (name == "ReturnToRealtimeButton")
542        return UI_STRING("return to realtime", "accessibility role description for return to real time button");
543    if (name == "CurrentTimeDisplay")
544        return UI_STRING("elapsed time", "accessibility role description for elapsed time display");
545    if (name == "TimeRemainingDisplay")
546        return UI_STRING("remaining time", "accessibility role description for time remaining display");
547    if (name == "StatusDisplay")
548        return UI_STRING("status", "accessibility role description for movie status");
549    if (name == "FullscreenButton")
550        return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button");
551    if (name == "SeekForwardButton")
552        return UI_STRING("fast forward", "accessibility role description for fast forward button");
553    if (name == "SeekBackButton")
554        return UI_STRING("fast reverse", "accessibility role description for fast reverse button");
555    if (name == "ShowClosedCaptionsButton")
556        return UI_STRING("show closed captions", "accessibility role description for show closed captions button");
557    if (name == "HideClosedCaptionsButton")
558        return UI_STRING("hide closed captions", "accessibility role description for hide closed captions button");
559
560    ASSERT_NOT_REACHED();
561    return String();
562}
563
564String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name)
565{
566    if (name == "AudioElement")
567        return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller");
568    if (name == "VideoElement")
569        return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller");
570    if (name == "MuteButton")
571        return UI_STRING("mute audio tracks", "accessibility help text for mute button");
572    if (name == "UnMuteButton")
573        return UI_STRING("unmute audio tracks", "accessibility help text for un mute button");
574    if (name == "PlayButton")
575        return UI_STRING("begin playback", "accessibility help text for play button");
576    if (name == "PauseButton")
577        return UI_STRING("pause playback", "accessibility help text for pause button");
578    if (name == "Slider")
579        return UI_STRING("movie time scrubber", "accessibility help text for timeline slider");
580    if (name == "SliderThumb")
581        return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb");
582    if (name == "RewindButton")
583        return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button");
584    if (name == "ReturnToRealtimeButton")
585        return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button");
586    if (name == "CurrentTimeDisplay")
587        return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display");
588    if (name == "TimeRemainingDisplay")
589        return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display");
590    if (name == "StatusDisplay")
591        return UI_STRING("current movie status", "accessibility help text for movie status display");
592    if (name == "SeekBackButton")
593        return UI_STRING("seek quickly back", "accessibility help text for fast rewind button");
594    if (name == "SeekForwardButton")
595        return UI_STRING("seek quickly forward", "accessibility help text for fast forward button");
596    if (name == "FullscreenButton")
597        return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button");
598    if (name == "ShowClosedCaptionsButton")
599        return UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button");
600    if (name == "HideClosedCaptionsButton")
601        return UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button");
602
603    ASSERT_NOT_REACHED();
604    return String();
605}
606
607String WebPlatformStrategies::localizedMediaTimeDescription(float time)
608{
609    if (!isfinite(time))
610        return UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value");
611
612    int seconds = (int)fabsf(time);
613    int days = seconds / (60 * 60 * 24);
614    int hours = seconds / (60 * 60);
615    int minutes = (seconds / 60) % 60;
616    seconds %= 60;
617
618    if (days)
619        return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"), days, hours, minutes, seconds)).get();
620
621    if (hours)
622        return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"), hours, minutes, seconds)).get();
623
624    if (minutes)
625        return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"), minutes, seconds)).get();
626
627    return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"), seconds)).get();
628}
629
630String WebPlatformStrategies::validationMessageValueMissingText()
631{
632    return UI_STRING("value missing", "Validation message for required form control elements that have no value");
633}
634
635String WebPlatformStrategies::validationMessageTypeMismatchText()
636{
637    return UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type");
638}
639
640String WebPlatformStrategies::validationMessagePatternMismatchText()
641{
642    return UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern");
643}
644
645String WebPlatformStrategies::validationMessageTooLongText()
646{
647    return UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length");
648}
649
650String WebPlatformStrategies::validationMessageRangeUnderflowText()
651{
652    return UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum");
653}
654
655String WebPlatformStrategies::validationMessageRangeOverflowText()
656{
657    return UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum");
658}
659
660String WebPlatformStrategies::validationMessageStepMismatchText()
661{
662    return UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute");
663}
664
665bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash)
666{
667    return page->group().isLinkVisited(hash);
668}
669
670void WebPlatformStrategies::addVisitedLink(Page* page, LinkHash hash)
671{
672    page->group().addVisitedLinkHash(hash);
673}
674