| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |