Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_result_view.cc

Issue 2871973002: Use ui::AX_EVENT_SELECTION to read aloud omnibox suggestion answers. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // For WinDDK ATL compatibility, these ATL headers must come first. 5 // For WinDDK ATL compatibility, these ATL headers must come first.
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 7
8 #if defined(OS_WIN) 8 #if defined(OS_WIN)
9 #include <atlbase.h> // NOLINT 9 #include <atlbase.h> // NOLINT
10 #include <atlwin.h> // NOLINT 10 #include <atlwin.h> // NOLINT
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 289 }
290 290
291 void OmniboxResultView::OnSelected() { 291 void OmniboxResultView::OnSelected() {
292 DCHECK_EQ(SELECTED, GetState()); 292 DCHECK_EQ(SELECTED, GetState());
293 293
294 // Notify assistive technology when results with answers attached are 294 // Notify assistive technology when results with answers attached are
295 // selected. The non-answer text is already accessible as a consequence of 295 // selected. The non-answer text is already accessible as a consequence of
296 // updating the text in the omnibox but this alert and GetAccessibleNodeData 296 // updating the text in the omnibox but this alert and GetAccessibleNodeData
297 // below make the answer contents accessible. 297 // below make the answer contents accessible.
298 if (match_.answer) 298 if (match_.answer)
299 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 299 NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true);
300 } 300 }
301 301
302 gfx::Size OmniboxResultView::GetPreferredSize() const { 302 gfx::Size OmniboxResultView::GetPreferredSize() const {
303 int height = GetTextHeight() + (2 * GetVerticalMargin()); 303 int height = GetTextHeight() + (2 * GetVerticalMargin());
304 if (match_.answer) 304 if (match_.answer)
305 height += GetAnswerHeight() + kVerticalPadding; 305 height += GetAnswerHeight() + kVerticalPadding;
306 return gfx::Size(0, height); 306 return gfx::Size(0, height);
307 } 307 }
308 308
309 void OmniboxResultView::GetAccessibleNodeData(ui::AXNodeData* node_data) { 309 void OmniboxResultView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 destination->AppendText(text); 807 destination->AppendText(text);
808 const TextStyle& text_style = GetTextStyle(text_type); 808 const TextStyle& text_style = GetTextStyle(text_type);
809 // TODO(dschuyler): follow up on the problem of different font sizes within 809 // TODO(dschuyler): follow up on the problem of different font sizes within
810 // one RenderText. Maybe with destination->SetFontList(...). 810 // one RenderText. Maybe with destination->SetFontList(...).
811 destination->ApplyWeight( 811 destination->ApplyWeight(
812 is_bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL, range); 812 is_bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL, range);
813 destination->ApplyColor( 813 destination->ApplyColor(
814 GetNativeTheme()->GetSystemColor(text_style.colors[GetState()]), range); 814 GetNativeTheme()->GetSystemColor(text_style.colors[GetState()]), range);
815 destination->ApplyBaselineStyle(text_style.baseline, range); 815 destination->ApplyBaselineStyle(text_style.baseline, range);
816 } 816 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698