Commit 289e5a21 authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Use sentence case for JS app-modal bubble titles

Covers widget dialog title sentence case for app_modal_strings.grdp.

This reverts the dialog titles to pre-titlecase "www.google.com says"
since this no longer looks wonky when there's no titlecase version of
it.

Bug: chromium:810111
Change-Id: I5f72d704629dfc1da1522c4a34707c5864a44947
Reviewed-on: https://chromium-review.googlesource.com/917467
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536911}
parent 6adfd83f
...@@ -16,99 +16,84 @@ TEST(JavaScriptDialogManagerTest, GetTitle) { ...@@ -16,99 +16,84 @@ TEST(JavaScriptDialogManagerTest, GetTitle) {
struct Case { struct Case {
const char* parent_url; const char* parent_url;
const char* alerting_url; const char* alerting_url;
const char* expected_titlecase; const char* expected;
const char* expected_no_titlecase;
const char* expected_android; const char* expected_android;
} cases[] = { } cases[] = {
// Standard main frame alert. // Standard main frame alert.
{"http://foo.com/", "http://foo.com/", "From foo.com", "From foo.com", {"http://foo.com/", "http://foo.com/", "foo.com says", "foo.com says"},
"From foo.com"},
// Subframe alert from the same origin. // Subframe alert from the same origin.
{"http://foo.com/1", "http://foo.com/2", "From foo.com", "From foo.com", {"http://foo.com/1", "http://foo.com/2", "foo.com says", "foo.com says"},
"From foo.com"},
// Subframe alert from a different origin. // Subframe alert from a different origin.
{"http://foo.com/", "http://bar.com/", "From an Embedded Page at bar.com", {"http://foo.com/", "http://bar.com/", "An embedded page at bar.com says",
"From an embedded page at bar.com", "From an embedded page at bar.com"}, "An embedded page at bar.com says"},
// file: // file:
// - main frame: // - main frame:
{"file:///path/to/page.html", "file:///path/to/page.html", {"file:///path/to/page.html", "file:///path/to/page.html",
"From This Page", "From this page", "From this page"}, "This page says", "This page says"},
// - subframe: // - subframe:
{"http://foo.com/", "file:///path/to/page.html", {"http://foo.com/", "file:///path/to/page.html",
"From an Embedded Page on This Page", "An embedded page on this page says",
"From an embedded page on this page", "An embedded page on this page says"},
"From an embedded page on this page"},
// ftp: // ftp:
// - main frame: // - main frame:
{"ftp://foo.com/path/to/page.html", "ftp://foo.com/path/to/page.html", {"ftp://foo.com/path/to/page.html", "ftp://foo.com/path/to/page.html",
"From foo.com", "From foo.com", "From ftp://foo.com"}, "foo.com says", "ftp://foo.com says"},
// - subframe: // - subframe:
{"http://foo.com/", "ftp://foo.com/path/to/page.html", {"http://foo.com/", "ftp://foo.com/path/to/page.html",
"From an Embedded Page at foo.com", "From an embedded page at foo.com", "An embedded page at foo.com says",
"From an embedded page at ftp://foo.com"}, "An embedded page at ftp://foo.com says"},
// data: // data:
// - main frame: // - main frame:
{"data:blahblah", "data:blahblah", "From This Page", "From this page", {"data:blahblah", "data:blahblah", "This page says", "This page says"},
"From this page"},
// - subframe: // - subframe:
{"http://foo.com/", "data:blahblah", "From an Embedded Page on This Page", {"http://foo.com/", "data:blahblah", "An embedded page on this page says",
"From an embedded page on this page", "An embedded page on this page says"},
"From an embedded page on this page"},
// javascript: // javascript:
// - main frame: // - main frame:
{"javascript:abc", "javascript:abc", "From This Page", "From this page", {"javascript:abc", "javascript:abc", "This page says", "This page says"},
"From this page"},
// - subframe: // - subframe:
{"http://foo.com/", "javascript:abc", {"http://foo.com/", "javascript:abc",
"From an Embedded Page on This Page", "An embedded page on this page says",
"From an embedded page on this page", "An embedded page on this page says"},
"From an embedded page on this page"},
// about: // about:
// - main frame: // - main frame:
{"about:blank", "about:blank", "From This Page", "From this page", {"about:blank", "about:blank", "This page says", "This page says"},
"From this page"},
// - subframe: // - subframe:
{"http://foo.com/", "about:blank", "From an Embedded Page on This Page", {"http://foo.com/", "about:blank", "An embedded page on this page says",
"From an embedded page on this page", "An embedded page on this page says"},
"From an embedded page on this page"},
// blob: // blob:
// - main frame: // - main frame:
{"blob:http://foo.com/66666666-6666-6666-6666-666666666666", {"blob:http://foo.com/66666666-6666-6666-6666-666666666666",
"blob:http://foo.com/66666666-6666-6666-6666-666666666666", "blob:http://foo.com/66666666-6666-6666-6666-666666666666",
"From foo.com", "From foo.com", "From foo.com"}, "foo.com says", "foo.com says"},
// - subframe: // - subframe:
{"http://bar.com/", {"http://bar.com/",
"blob:http://foo.com/66666666-6666-6666-6666-666666666666", "blob:http://foo.com/66666666-6666-6666-6666-666666666666",
"From an Embedded Page at foo.com", "From an embedded page at foo.com", "An embedded page at foo.com says", "An embedded page at foo.com says"},
"From an embedded page at foo.com"},
// filesystem: // filesystem:
// - main frame: // - main frame:
{"filesystem:http://foo.com/bar.html", {"filesystem:http://foo.com/bar.html",
"filesystem:http://foo.com/bar.html", "From foo.com", "From foo.com", "filesystem:http://foo.com/bar.html", "foo.com says", "foo.com says"},
"From foo.com"},
// - subframe: // - subframe:
{"http://bar.com/", "filesystem:http://foo.com/bar.html", {"http://bar.com/", "filesystem:http://foo.com/bar.html",
"From an Embedded Page at foo.com", "From an embedded page at foo.com", "An embedded page at foo.com says", "An embedded page at foo.com says"},
"From an embedded page at foo.com"},
}; };
for (const auto& test_case : cases) { for (const auto& test_case : cases) {
base::string16 result = JavaScriptDialogManager::GetTitleImpl( base::string16 result = JavaScriptDialogManager::GetTitleImpl(
GURL(test_case.parent_url), GURL(test_case.alerting_url)); GURL(test_case.parent_url), GURL(test_case.alerting_url));
#if defined(OS_MACOSX) #if defined(OS_ANDROID)
EXPECT_EQ(test_case.expected_titlecase, base::UTF16ToUTF8(result));
#elif defined(OS_ANDROID)
EXPECT_EQ(test_case.expected_android, base::UTF16ToUTF8(result)); EXPECT_EQ(test_case.expected_android, base::UTF16ToUTF8(result));
#else #else
EXPECT_EQ(test_case.expected_no_titlecase, base::UTF16ToUTF8(result)); EXPECT_EQ(test_case.expected, base::UTF16ToUTF8(result));
#endif #endif
} }
} }
......
...@@ -2,49 +2,27 @@ ...@@ -2,49 +2,27 @@
<grit-part> <grit-part>
<!-- JavaScript Dialog Box strings --> <!-- JavaScript Dialog Box strings -->
<if expr="not use_titlecase">
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE" desc="Title for JavaScript prompt and confirm originating from a webpage"> <message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE" desc="Title for JavaScript prompt and confirm originating from a webpage">
From <ph name="SITE">$1<ex>http://www.google.com</ex></ph> <ph name="SITE">$1<ex>http://www.google.com</ex></ph> says
</message> </message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage"> <message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage">
From an embedded page at <ph name="SITE">$1<ex>http://www.google.com</ex></ph> An embedded page at <ph name="SITE">$1<ex>http://www.google.com</ex></ph> says
</message> </message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL" desc="Title for JavaScript prompt and confirm originating from a webpage with a non-standard URL such as |data:|"> <message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL" desc="Title for JavaScript prompt and confirm originating from a webpage with a non-standard URL such as |data:|">
From this page This page says
</message> </message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage with a non-standard URL such as |data:|"> <message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage with a non-standard URL such as |data:|">
From an embedded page on this page An embedded page on this page says
</message> </message>
</if>
<if expr="use_titlecase">
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE" desc="Title for JavaScript prompt and confirm originating from a webpage">
From <ph name="SITE">$1<ex>http://www.google.com</ex></ph>
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage">
From an Embedded Page at <ph name="SITE">$1<ex>http://www.google.com</ex></ph>
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL" desc="Title for JavaScript prompt and confirm originating from a webpage with a non-standard URL such as |data:|">
From This Page
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage with a non-standard URL such as |data:|">
From an Embedded Page on This Page
</message>
</if>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_SUPPRESS_OPTION" desc="Optional UI shown on the message box, in the form of a checkbox, allowing the user to suppress additional message boxes from the page."> <message name="IDS_JAVASCRIPT_MESSAGEBOX_SUPPRESS_OPTION" desc="Optional UI shown on the message box, in the form of a checkbox, allowing the user to suppress additional message boxes from the page.">
Prevent this page from creating additional dialogs Prevent this page from creating additional dialogs
</message> </message>
<!-- "Before Unload" Dialog Box strings --> <!-- "Before Unload" Dialog Box strings -->
<if expr="not use_titlecase">
<message name="IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog."> <message name="IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog.">
Do you want to leave this site? Do you want to leave this site?
</message> </message>
</if>
<if expr="use_titlecase">
<message name="IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog.">
Do You Want to Leave This Site?
</message>
</if>
<message name="IDS_BEFOREUNLOAD_MESSAGEBOX_MESSAGE" desc="Text shown as the message of the 'before unload' dialog."> <message name="IDS_BEFOREUNLOAD_MESSAGEBOX_MESSAGE" desc="Text shown as the message of the 'before unload' dialog.">
Changes you made may not be saved. Changes you made may not be saved.
</message> </message>
...@@ -53,16 +31,9 @@ ...@@ -53,16 +31,9 @@
</message> </message>
<!-- "Before Reload" Dialog Box strings (same as "Before Unload" but when reloading rather than unloading the page --> <!-- "Before Reload" Dialog Box strings (same as "Before Unload" but when reloading rather than unloading the page -->
<if expr="not use_titlecase">
<message name="IDS_BEFORERELOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog for reloads."> <message name="IDS_BEFORERELOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog for reloads.">
Do you want to reload this site? Do you want to reload this site?
</message> </message>
</if>
<if expr="use_titlecase">
<message name="IDS_BEFORERELOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog for reloads.">
Do You Want to Reload This Site?
</message>
</if>
<message name="IDS_BEFORERELOAD_MESSAGEBOX_OK_BUTTON_LABEL" desc="The text on the button which reloads the page."> <message name="IDS_BEFORERELOAD_MESSAGEBOX_OK_BUTTON_LABEL" desc="The text on the button which reloads the page.">
Reload Reload
</message> </message>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment