diff options
author | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 16:48:47 +0000 |
---|---|---|
committer | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 16:48:47 +0000 |
commit | ac537c33a1f639d7439f02d899bd33013694d3fa (patch) | |
tree | 7d868c4eacd54fb0aa8f940565556749d507c63d /views | |
parent | 0c93d31fd16ca9f2405065f8f748f03887188f63 (diff) | |
download | chromium_src-ac537c33a1f639d7439f02d899bd33013694d3fa.zip chromium_src-ac537c33a1f639d7439f02d899bd33013694d3fa.tar.gz chromium_src-ac537c33a1f639d7439f02d899bd33013694d3fa.tar.bz2 |
Append "(Incognito)" to the accessible title of the browser window.
This actual window title remains the same.
BUG=37357
TEST=Screen readers read "Incognito" for browser windows that are off the record.
Review URL: http://codereview.chromium.org/3400028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60658 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/window/window_delegate.h | 5 | ||||
-rw-r--r-- | views/window/window_win.cc | 7 | ||||
-rw-r--r-- | views/window/window_win.h | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/views/window/window_delegate.h b/views/window/window_delegate.h index 95ae934..826d6b7 100644 --- a/views/window/window_delegate.h +++ b/views/window/window_delegate.h @@ -64,6 +64,11 @@ class WindowDelegate { return 0; } + // Returns the title to be read with screen readers. + virtual std::wstring GetAccessibleWindowTitle() const { + return GetWindowTitle(); + } + // Returns the text to be displayed in the window title. virtual std::wstring GetWindowTitle() const { return L""; diff --git a/views/window/window_win.cc b/views/window/window_win.cc index c81fe27..5bbc13c 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -418,7 +418,7 @@ void WindowWin::UpdateWindowTitle() { SetWindowText(GetNativeView(), window_title.c_str()); // Also update the accessibility name. - UpdateAccessibleName(window_title); + UpdateAccessibleName(); } void WindowWin::UpdateWindowIcon() { @@ -1408,14 +1408,15 @@ void WindowWin::ResetWindowRegion(bool force) { DeleteObject(current_rgn); } -void WindowWin::UpdateAccessibleName(std::wstring name) { +void WindowWin::UpdateAccessibleName() { ScopedComPtr<IAccPropServices> pAccPropServices; + std::wstring accessible_title = window_delegate_->GetAccessibleWindowTitle(); HRESULT hr = CoCreateInstance(CLSID_AccPropServices, NULL, CLSCTX_SERVER, IID_IAccPropServices, reinterpret_cast<void**>(&pAccPropServices)); if (SUCCEEDED(hr)) { VARIANT var; var.vt = VT_BSTR; - var.bstrVal = SysAllocString(name.c_str()); + var.bstrVal = SysAllocString(accessible_title.c_str()); hr = pAccPropServices->SetHwndProp(GetNativeView(), OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_NAME, var); } diff --git a/views/window/window_win.h b/views/window/window_win.h index 60210f9..98ff7070 100644 --- a/views/window/window_win.h +++ b/views/window/window_win.h @@ -194,7 +194,7 @@ class WindowWin : public WidgetWin, void ResetWindowRegion(bool force); // Update accessibility information via our WindowDelegate. - void UpdateAccessibleName(std::wstring name); + void UpdateAccessibleName(); void UpdateAccessibleRole(); void UpdateAccessibleState(); |