Commit cba8bb5b authored by Nektarios Paisios's avatar Nektarios Paisios Committed by Commit Bot

Avoids crash in content_shell when accessibility is on

Windows screen readers call IAccessible::get_appName and IAccessible::get_appVersion to determine that Chrome is running and retrieve its version for loading the correct scripts.
However, when the content_shell is running instead of Chrome, |GetProduct| returns an empty string.
Since screen reader access is not essential while content_shell is running, we simply return E_FAIL for both these API calls rather than DCHECK.
R=dmazzoni@chromium.org

Change-Id: Iec62c134cd55b204fe460ff0d632b280996297a3
Reviewed-on: https://chromium-review.googlesource.com/1232583Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592516}
parent b52e5772
......@@ -95,7 +95,8 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_appName(BSTR* app_name) {
std::vector<std::string> product_components =
base::SplitString(GetContentClient()->GetProduct(), "/",
base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
DCHECK_EQ(2U, product_components.size());
// |GetProduct| will return an empty string if we are running the content
// shell instead of Chrome.
if (product_components.size() != 2)
return E_FAIL;
*app_name = SysAllocString(base::UTF8ToUTF16(product_components[0]).c_str());
......@@ -114,7 +115,8 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_appVersion(BSTR* app_version) {
std::vector<std::string> product_components =
base::SplitString(GetContentClient()->GetProduct(), "/",
base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
DCHECK_EQ(2U, product_components.size());
// |GetProduct| will return an empty string if we are running the content
// shell instead of Chrome.
if (product_components.size() != 2)
return E_FAIL;
*app_version =
......
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