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